Skip to content

fix(codex): bound the Codex run and export TEND_DEADLINE like Claude - #1748

Merged
max-sixty merged 2 commits into
mainfrom
fix/codex-session-deadline
Nov 27, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/codex-session-deadline

Conversation

@tend-agent

@tend-agent tend-agent commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

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.

  • Supervisor. codex exec now 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 from run_claude.py to tend.runtime.shared.supervise. A stream with no file given is inherited, so Codex output still goes to the job log.
  • Bound and deadline. codex/action.yaml gains a timeout_seconds input with Claude's default of 21000 s and passes it as TEND_TIMEOUT_SEC. The runner exports TEND_DEADLINE (now + bound, from the same supervise.deadline Claude uses) and lowers background_terminal_max_timeout from 6 h to the bound, matching Claude's BASH_MAX_TIMEOUT_MS. A timed-out run prints the Supervisor: status=timeout … line and fails with ::error::Codex run exceeded <N>s timeout.
  • Tests. The poll's deadline tests in test_poll_scripts.py now take TEND_DEADLINE from each harness's real entry point (run_claude.main and codex_runner.run_codex, with the launch faked), parametrized [claude]/[codex]. With the runner change reverted, the [codex] cases fail because no TEND_DEADLINE crosses. 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 that TEND_DEADLINE reaches the Codex process.

Locally, the full Python suite passes except the two test_refresh_consumers.py tests that need DNS, which the sandbox lacks. pre-commit run --all-files is clean, and CI is green at dbc10c7f.

Closes #1524

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
@max-sixty
max-sixty merged commit 3496b11 into main Nov 27, 2026
12 checks passed
@max-sixty
max-sixty deleted the fix/codex-session-deadline branch November 27, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

poll_pr_checks.py poll: a review killed by the session timeout leaves its approval standing over a red check

2 participants