Skip to content

fix(codex): keep exec cells and wait calls from cutting a CI poll into 1-second turns - #1641

Merged
max-sixty merged 1 commit into
mainfrom
daily/review-runs-41598804136-codex-wait
Nov 3, 2026
Merged

max-sixty merged 1 commit into
mainfrom
daily/review-runs-41598804136-codex-wait

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

Codex sessions that wait on a CI poll spend most of their tokens checking in on it every few seconds, even though codex/agents-tail.md already says to wait once. The current guidance covers only exec_command and write_stdin. Under the pinned Codex 0.160.0 those calls run inside a code-mode exec cell. The cell's // @exec pragma has its own yield_time_ms, and so does the wait tool that resumes a yielded cell. A short value there hands control back early, whatever the inner write_stdin asked for. This PR names those two layers in the existing bullet and gives every layer an hour (3600000).

What we saw. Triage of #1632 (run 41409163237) started tend runtime poll-pr-checks and correctly called write_stdin(..., yield_time_ms: 300000). But it did so inside a cell headed // @exec: {"yield_time_ms": 1000}. The cell yielded after one second, and the model then called wait on it 43 times at 1–10 s intervals, plus 15 sleep calls. The fix was finished about 5 minutes in. The remaining roughly 22 minutes went on CI jobs queued behind other runs, and that waiting accounts for about 7.5M of the session's 10.9M input tokens. The weekly pin subagent in run 41409250004 shows the same pattern.

Why the new values are accepted. Codex 0.160.0's code-mode source (code-mode-protocol/src/description.rs) documents the pragma's yield_time_ms, and wait defaults to 10 s. code-mode-runtime/src/service.rs caps that wait only by an optional per-cell limit, which local sessions do not set. write_stdin is already allowed six hours by background_terminal_max_timeout in runner.py. exec_command clamps to 30 s on its own, so the bullet still sends a long wait through write_stdin.

This repo now runs on Claude (#1639), so the change won't show up in its own runs. It reaches Codex consumers with the next release. The related tests (test_repo_pins.py, test_codex_runner.py) and pre-commit pass.

@tend-agent tend-agent added the review-runs Findings from review-runs skill label Nov 3, 2026
@max-sixty
max-sixty merged commit 84c4313 into main Nov 3, 2026
12 checks passed
@max-sixty
max-sixty deleted the daily/review-runs-41598804136-codex-wait branch November 3, 2026 08:19
max-sixty added a commit that referenced this pull request Nov 27, 2026
… harness meets them (#1751)

Follows #1676: tend's instructions should say what a session must
achieve and leave out how a harness gets it there, since harness
mechanics go stale between releases. This removes six passages that
describe harness mechanics, and adds the rule that keeps new ones out.

- **The `.claude/skills/` write workaround** in propose-instructions and
review-runs (read-only mount, harness write-guard, write to `$TMPDIR`
then `mv`) no longer holds. anthropics/claude-code#37157 was fixed in
2.1.126 and tend pins 2.1.330. A probe on 2.1.332 wrote into
`.claude/skills/` with no denial, and the mount went with the sandbox
runtime in #1354. If that probe misled us, the edit fails visibly.
Tend's own running-tend overlay loses its pointer to the workaround too.
- **ground-claims' 32 KB threshold** was measured on Claude only. The
rule to project narrowly stays.
- **run-tend's "the harness does not load them…" clause** explains a
rule that stays.
- **Three asides** that the tools' own descriptions already carry.

propose-instructions' "What the text carries" gains the rule.
AGENTS.md's "Mechanics ship freely" narrows to match: it is the clause
that let #1676's first draft through.

Kept: Codex's `yield_time_ms` waits (#1448, #1641), reading skills in
full with `cat` (#551), absolute paths for file-writing tools, and the
command timeouts.

pre-commit passes locally; CI runs the suite.

> _This was written by Claude Code on behalf of max-sixty_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-runs Findings from review-runs skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants