From 4ac2b9066be286e105c2749467b2d9f97d0569c2 Mon Sep 17 00:00:00 2001 From: Eyejoker Date: Tue, 31 Mar 2026 06:47:58 +0900 Subject: [PATCH] fix: auto-retry Codex turn once on interrupted status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the Codex SDK returns 'interrupted' (API-side timeout/disconnect), retry the turn once before reporting failure. Prevents unnecessary "요청을 완료하지 못했습니다" messages for transient issues. --- runners/codex-runner/src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runners/codex-runner/src/index.ts b/runners/codex-runner/src/index.ts index 1f7ae40..8159712 100644 --- a/runners/codex-runner/src/index.ts +++ b/runners/codex-runner/src/index.ts @@ -281,6 +281,7 @@ async function executeAppServerTurn( client: CodexAppServerClient, threadId: string, prompt: string, + retryCount = 0, ): Promise<{ result: string | null; error?: string }> { let lastProgressMessage: string | null = null; const activeTurn = await client.startTurn(threadId, parseAppServerInput(prompt), { @@ -352,6 +353,10 @@ async function executeAppServerTurn( if (state.status === 'interrupted' && consumeCloseSentinel()) { return { result }; } + if (state.status === 'interrupted' && retryCount < 1) { + log('Codex turn interrupted, retrying once...'); + return executeAppServerTurn(client, threadId, prompt, retryCount + 1); + } return { result, error: state.errorMessage || `Codex turn finished with status ${state.status}`,