Skip to content

Commit 8df7f0b

Browse files
committed
debugging opencode failures on gpt-5-codex
1 parent 9382b63 commit 8df7f0b

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

agents/opencode.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,25 @@ const customFetch = async (request: Request): Promise<Response> => {
7676

7777
const opencodePort = await detectPort(4096);
7878

79+
// Set OpenCode config before server starts to ensure timeout is applied
80+
const opencodeConfig = {
81+
permission: DEFAULT_PERMISSION_CONFIG,
82+
provider: {
83+
opencode: {
84+
options: {
85+
timeout: 1_500_000, // 25 minutes timeout for OpenCode provider requests
86+
},
87+
},
88+
},
89+
};
90+
91+
// Set via environment variable to ensure it's picked up by the server
92+
process.env.OPENCODE_CONFIG_CONTENT = JSON.stringify(opencodeConfig);
93+
7994
const opencode = await createOpencode({
8095
port: opencodePort,
81-
timeout: 1_500_000, // 25 minutes timeout for long-running LLM requests
82-
config: {
83-
permission: DEFAULT_PERMISSION_CONFIG,
84-
},
96+
timeout: 1_500_000, // 25 minutes timeout for server startup
97+
config: opencodeConfig,
8598
});
8699

87100
const sessionCache = new Map<string, string>();

0 commit comments

Comments
 (0)