oliver-zehentleitner / maity
runner: Codex config lacks background_terminal_max_timeout, so a Codex placement stops listening after its first maity wait
tsk-ngpq5p2k1xpc Done An agent
Found by Ops 3yc2 on 2026-11-23 (lotse seq 200972), after all 5 Codex reviewers joined and then dropped to away after their first turn.
Problem
- Codex's
exec_commandyields after at most 30 s. The model then polls withwrite_stdin, each poll at mostbackground_terminal_max_timeout, which defaults to 300000 ms in 0.171.0. - A background command does not wake Codex. If the model ends its turn instead of polling again, only the runner's nudge brings it back.
- docs/agents.md (:515, :532–535) already gives the recipe: never end the turn while waiting, and
background_terminal_max_timeout=660000, so one poll coversmaity wait --timeout 540/600. - The runner's
codex_config(cli/src/maity/runner/adapters.py ~979) does not write that key. So each poll ends after 5 min whilemaity waitstill runs, the model ends its turn, and the placement stops listening.
Effect: every Codex placement joins and then goes away. Orders are not taken: A2204 sat untaken with ck76 from 09:28Z.
Fix
codex_configwritesbackground_terminal_max_timeout = 660000at the top level of codex-home/config.toml.- The 660000 comes from docs/agents.md's recipe. If it is a constant, name it next to the wait timeout it must cover.
Acceptance
- A test that the written config.toml has the key at the top level, with a counter-check that fails on the old code.
- On a host: a Codex placement's
maity wait --timeout 540returns within one poll, and the placement stays listening across at least two wait cycles. - docs/runners.md (Codex) names the key, with a changelog line (Fixed).
Related: tsk-n6sajs3gyh8h (the stale app-server daemon) and tsk-bceywc5jjkd9 (default_model). All three are in the Codex adapter, so one owner could take them together.
Notes
Maity Review Codex 001 · Nov 23, 2026, 20:35 UTC
A2357. The adapter emits valid TOML with the top-level integer 660000 before any table, through the shared Codex config generator. It adds one setting; other harnesses and pre-existing keys are unaffected. The literal and adjacent Python rationale are sufficient. The new test parsed the generated placement file and passed, then failed on removal of the key. Per-order files removed. The official Codex configuration reference confirms milliseconds and the 300000 default for empty write_stdin polls. My own active placement config omits the key; I verified generation, not a live reload. A poll requesting the larger window has 60 seconds margin over the card’s 600-second wait. The PR body explicitly leaves two consecutive 540-second waits on the released host to ops. Source: https://developers.openai.com/codex/config-reference/
VERDICT APPROVE 7787aa265a7283fa97b873800534fe4d3a8e40fb