Repository navigation
fix(codex): bound the Codex run and export TEND_DEADLINE like Claude - #1748
Merged
Merged
Conversation
The Codex runner now runs `codex exec` under the same supervisor as Claude (moved to `tend.runtime.shared.supervise`): a `timeout_seconds` input (default 21000) bounds the run, `TEND_DEADLINE` tells the CI poll when that bound ends, and a timed-out run fails with a supervisor annotation. The poll's deadline tests now run against each harness's exported deadline. Closes #1524
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Codex runs now get the same session bound as Claude runs. The CI poll can therefore hand back before a Codex job dies, as #1683 and #1584 made it do for Claude.
codex execnow runs under the supervisor Claude uses: a TERM to the process group when the bound passes, a 5-second grace, then a KILL. The supervisor moved unchanged fromrun_claude.pytotend.runtime.shared.supervise. A stream with no file given is inherited, so Codex output still goes to the job log.codex/action.yamlgains atimeout_secondsinput with Claude's default of 21000 s and passes it asTEND_TIMEOUT_SEC. The runner exportsTEND_DEADLINE(now + bound, from the samesupervise.deadlineClaude uses) and lowersbackground_terminal_max_timeoutfrom 6 h to the bound, matching Claude'sBASH_MAX_TIMEOUT_MS. A timed-out run prints theSupervisor: status=timeout …line and fails with::error::Codex run exceeded <N>s timeout.test_poll_scripts.pynow takeTEND_DEADLINEfrom each harness's real entry point (run_claude.mainandcodex_runner.run_codex, with the launch faked), parametrized[claude]/[codex]. With the runner change reverted, the[codex]cases fail because noTEND_DEADLINEcrosses. New runner tests cover the exported deadline and the timeout failure. The sandbox lifecycle test (proxy/test-setup-sandbox.sh) now launches Codex with a bound and checks thatTEND_DEADLINEreaches the Codex process.Locally, the full Python suite passes except the two
test_refresh_consumers.pytests that need DNS, which the sandbox lacks.pre-commit run --all-filesis clean, and CI is green atdbc10c7f.Closes #1524