Skip to content

Commit d34556b

Browse files
committed
debugging opencode failures on gpt-5-codex
1 parent f15292a commit d34556b

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

agents/opencode.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,20 @@ const DEFAULT_PERMISSION_CONFIG: NonNullable<OpencodeConfig["permission"]> = {
2424

2525
// Custom fetch with 25-minute timeout
2626
const customFetch = async (request: Request): Promise<Response> => {
27-
return fetch(request, {
28-
signal: AbortSignal.timeout(1_500_000),
29-
});
27+
const startTime = Date.now();
28+
29+
try {
30+
const response = await fetch(request, {
31+
signal: AbortSignal.timeout(1_500_000),
32+
});
33+
const duration = Date.now() - startTime;
34+
console.error(`[opencode] Request completed - Duration: ${duration}ms`);
35+
return response;
36+
} catch (error) {
37+
const duration = Date.now() - startTime;
38+
console.error(`[opencode] Request failed - Duration: ${duration}ms`);
39+
throw error;
40+
}
3041
};
3142

3243
const opencodePort = await detectPort(4096);

0 commit comments

Comments
 (0)