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}`,