Repository navigation
fix(codex): keep exec cells and wait calls from cutting a CI poll into 1-second turns - #1641
Merged
Merged
Conversation
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_
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 sessions that wait on a CI poll spend most of their tokens checking in on it every few seconds, even though
codex/agents-tail.mdalready says to wait once. The current guidance covers onlyexec_commandandwrite_stdin. Under the pinned Codex 0.160.0 those calls run inside a code-modeexeccell. The cell's// @execpragma has its ownyield_time_ms, and so does thewaittool that resumes a yielded cell. A short value there hands control back early, whatever the innerwrite_stdinasked 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-checksand correctly calledwrite_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 calledwaiton it 43 times at 1–10 s intervals, plus 15sleepcalls. 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'syield_time_ms, andwaitdefaults to 10 s.code-mode-runtime/src/service.rscaps that wait only by an optional per-cell limit, which local sessions do not set.write_stdinis already allowed six hours bybackground_terminal_max_timeoutinrunner.py.exec_commandclamps to 30 s on its own, so the bullet still sends a long wait throughwrite_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.