Skip to content

fix: preserve long foreground task recovery#550

Open
hogeheer499-commits wants to merge 1 commit into
openai:mainfrom
hogeheer499-commits:agent/preserve-foreground-recovery-542
Open

fix: preserve long foreground task recovery#550
hogeheer499-commits wants to merge 1 commit into
openai:mainfrom
hogeheer499-commits:agent/preserve-foreground-recovery-542

Conversation

@hogeheer499-commits

Copy link
Copy Markdown

Fixes #542.

Claude Code terminates foreground Bash calls after 600 seconds. A Codex task that crosses that boundary can already have a persisted thread, but the companion currently returns the resumable thread ID only in its final output, which never arrives after the host kills the call.

This schedules a recovery hint once the foreground task has a thread ID. If the task is still running after eight minutes, the companion writes codex resume <thread-id> synchronously to stdout before the host timeout. Short tasks and JSON output remain unchanged. The rescue guidance now also names the 600-second limit and prefers background execution for work that could approach it.

Regression coverage uses a shortened hint delay and verifies that the recovery command is emitted before the eventual task result.

Tests:

  • npm test (92 passed)
  • npm run build

@hogeheer499-commits
hogeheer499-commits requested a review from a team July 24, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant