Repository navigation
Sort a red suite by what the failure is, not by how steady it looks - #42
Merged
Merged
Conversation
The triage list called moving failures contention and said to re-run. Failures move here in every class, and the class that dominates — a read or press that ran before the page said it was ready — was not on the list and is the one a re-run hides. Put it first, demote contention to a signature confirmed from the machine, and prefer an `-n0` reproduction to a re-run that discards the evidence.
leaf-agent
commented
Aug 25, 2026
leaf-agent
left a comment
Collaborator
Author
There was a problem hiding this comment.
Reordering the list is right, and the first bullet is the class this repo's reds actually are — the evidence in the description carries it. Three places where the new text asks for something a session here can't do, or concludes more than the evidence supports.
The load-bearing one is the -n0 paragraph: it says reproduction separates a race from contention, but the description's own fifth row (test_a_message_reference_travels_or_says_it_cant, 3–4 misses per 60 presses) is a race that a single -n0 run would have missed. With contention sitting right above as the remaining bullet, a failed reproduction routes straight to the "re-run and shrug" outcome this PR exists to close.
Reproduction at -n0 only classifies one way, so say so and say what to do when it comes up empty. Confirm contention from the run's own job timings, which a later ci-fix session can still read. Justify the movement test with the observation that reaches it.
…24406080 # Conflicts: # .claude/skills/running-tend/SKILL.md
This was referenced Aug 26, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 21, 2026
…3460) Builds Max's decision #42 on the overnight report, "Carry it quietly": trust a Codex turn's hooks from the turn's start. On the `codex queue` route (the desktop app and IDE), the adapter left a running turn's input to its hooks only once a tool step had run in the task's current instance (`step_hook_ran`). The desktop app unloads an idle chat, and the instance's end retires that mark, so in the next turn a comment that arrived before the first tool call went to `codex queue`. Codex runs a queued pointer only once the running turn ends, as a turn of its own opening on a `leaf-delivery` message in the user's name, which is the noise Max ruled out ("In codex, adding a message to the user turn is very noisy to the user, so we only want to do it when we need to"). ### What changes - **The queue adapter leaves a running turn's input to it from the turn's start, wherever Leaf will see that turn end** (`codex_adapter._offer_queued_delivery`). The comment then enters quietly at the turn's first tool step, or at Stop in a turn that runs no tool. Leaf sees the end through the hooks, where any Leaf hook has run in the task's instance (`leases.hooks_ran`), as the turn's prompt hook does at its start, or through Codex's transcript, which the task's hooks named in its session record and which the adapter reads before each offer. The transcript matters for the first second of a turn after an unload, when it shows the turn before the new instance's first hook has run. - **No path loses a comment.** Waiting costs nothing on this route, since a queued pointer would wait for the turn to end anyway. A turn whose tool and Stop hooks don't run still ends in Codex's transcript or by Interrupt, and the adapter then queues the comment, or a pointer the turn left unread. A task with neither a hook run nor a known transcript has nothing that would show its turn end before the claim's turn ages out after 15 minutes, so there the adapter queues at once, as before. - **One hook proof.** `CodexHarness.turn_takes_input`, which the page's activity reads, uses `hooks_ran` too, so the step-hook mark (`mark_step_hook`, `step_hook_ran`, `STEP_HOOK_SUFFIX`) is deleted, along with the adapter's special case for a Stop offer made before any tool step, which the new condition covers. - **A journey step covers it.** The Codex journeys gain an `unload` step. On `codex-queue` the user leaves the task (`thread/unsubscribe`), which closes it and runs its SessionEnd hook as the desktop app's unload does, and resumes it. On both routes a comment is then sent once the claim names the user's next turn and before its first tool call, and the step requires the comment to enter that turn and start no turn of its own. The journey now resumes a task with the cwd, approval policy and sandbox it started with, since a bare `thread/resume` reset the approval policy and the task's `leaf` MCP tool then asked for approval. The App Server route is unchanged: its adapter already waits for any running turn, and its Stop hands nothing in. ### Evidence (codex-cli 0.160.0) - An App Server probe showed that `thread/unsubscribe` from a thread's last client closes the thread (`thread/closed`) and runs its SessionEnd hook, which retired the hook mark. `thread/resume` runs no hook; the next turn's SessionStart and prompt hooks do. - On `main` with the new step, `codex-queue` fails it: the comment was queued while the turn wrote its opening sentences, the turn's Stop handed it in, and Codex then opened another turn on the `leaf-delivery` message (`the comment sent before the first tool call started a turn of its own`). `codex-app-server` passes it. - A first version that trusted only a hook run failed the same way: the claim named the new turn from the transcript, the comment arrived 120 ms later, and the instance's first hook ran about a second after that, so the adapter queued the comment. Reading the transcript as well closes that gap. - With this change both journeys pass every step. In the `codex-queue` run the comment entered the user's turn at its `printf` step and was answered there, and no other turn started. ### Tests - `test_a_comment_before_a_turns_first_tool_step_enters_that_turn`: with the turn known from its prompt hook (entering at the first tool step, and at Stop) or only from the transcript after an instance ended, the adapter queues nothing and the comment opens in the user's turn. All three fail on `main`, where the adapter queues it. - `test_a_comment_left_to_a_turn_whose_hooks_never_run_is_queued_as_it_ends`: the adapter holds the comment while the turn runs, and queues it once the transcript records the turn's end, with no hook run. It fails on `main`, which queues at once. - The adapter tests whose tasks run no hook and name no transcript, such as `test_codex_serializes_later_input_behind_the_offered_delivery`, still queue at once; they failed against a version that trusted every running turn. - Tests that marked a tool step mark a hook run instead. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
Problem
running-tend's red-suite triage sorts on a property this repo's failures have in every class. "A run whose failures move between runs is this. Re-run before diagnosing" points at contention, butmaintakes ~17 commits a day and reddens on a different test most days, so failures move whichever class they are. In the last 24 hoursmainwent red on 16ciruns across five distinct tests, and none of them was contention: four reproduced deterministically at-n0and the fifth reproduced at a measured rate under load and was still a real defect with a real fix.The class that actually dominates here isn't on the list at all: a test that reads, measures, or presses before the page has arrived at the state the gesture needs.
tests/CLAUDE.mdalready names it twice — "State races are arrangements, not probabilities" and "A state the page passes through is not a state to poll for" — and it is what PRs #13, #21, #24, #25, #26 and #39 all were. It is also the class a re-run most reliably hides, so the current guidance routes it to the one action that buries it.Fix
Reorder the list to put that class first, demote contention to third with a signature confirmed from the run's own job timings rather than from the spread of failures, and replace the falsified "failures move between runs" test with the observation that reaches it — those failures reproduced on their own commit. Plus one paragraph on re-running: prefer
-n0reproduction, which keeps the evidence and settles whether the failure is real, but only in that direction, so a failure that doesn't reproduce is unclassified rather than contention and wants a rate measured before it falls through. And if you re-run anyway, cite the attempt you read — a second attempt replaces the run's reported conclusion while both stay separately true.No new section, no new machinery. Four bullets where there were three, and the two that survive unchanged keep their wording.
Verification
Documentation only.
pre-commit run --files .claude/skills/running-tend/SKILL.mdis clean.Evidence: five sweeps, and this window's five classes
This was pre-registered in the tracking issue (#17) on 2026-08-22 as HELD UNDER THE PR BUDGET — the finding passed the gates then, but the bot had six PRs open and
running-in-ci's five-PR ceiling holds a self-initiated finding that is not a wrong outward action. The queue was drained on the evening of 2026-08-24 (ten merges), so it is now unblocked. The change is what that entry said it would be: "a correction to the existing three-class list plus one line saying to cite the attempt, not a new section."Historical. Run 32560880519 recorded 12 red runs the guidance mis-sorts, plus one re-run whose attempt 2 failed on a disjoint pair and left PR #25's body — written against attempt 1 — needing a follow-up comment to scope itself. Runs 32346633522 and 32461139191 carry the same shape under their
tend-ci-fixfindings.This window (2026-08-24T08:03Z → now), all five traced from their own job logs:
test_a_note_sets_the_page_axis_with_its_whole_striptest_an_open_composer_does_not_eat_the_next_clickmarkAt's tightened veto correctly declined it. Reproduced locally at-n0.test_the_page_marks_the_comment_the_reader_is_standing_inpage.mouse.movewas read while the body was still carrying amargin-righttransition at 35.3px on its way to 420px; 600ms later the mark had moved to x=172.7–236.4. Fixed withpanel_settledin #39.test_a_pointer_drag_stops_the_line_offering_the_press_it_refusesee4d444's key-line rewrite; the read asked for a chip that page can no longer paint.test_a_message_reference_travels_or_says_it_cantTarget.getTargetsshowing an attached pagecontext.pagesnever reported). Probabilistic, but not contention — a latent instrument defect, fixed in #40.Five different tests over 16 reds is exactly the "failures move between runs" signature the current text calls contention, and the sessions that diagnosed them (32750690010, 32780135894, 32792013486) all went past the contention branch before doing real work. Nothing has yet been mis-classified — the risk the current text carries is a false all-clear on a
mainthat this same skill calls live.What is deliberately left out. The last row is a fourth candidate class (the instrument losing a handle, as distinct from the subject being flaky) with one occurrence. A new bullet needs 3+ under the magnitude gate, so it is recorded in #17 rather than added here; the contention bullet's "confirm it from the machine" clause is enough to keep it from being re-run and shrugged off in the meantime.