Repository navigation
fix(poll-pr-checks): end the wait at the session deadline when rollup reads keep failing - #1730
Conversation
… reads keep failing After one complete rollup read, _settle retried failed reads without checking TEND_DEADLINE, so a GitHub outage after the checks settled kept poll and approval waiting until the harness killed the session.
tend-agent
left a comment
There was a problem hiding this comment.
The new "deadline" return can carry a read with nothing pending, but only one of the three printers that handle that outcome checks for it. Elsewhere the output still says checks are pending and then lists none:
approval: a deadline result with no red printssession ends soon with checks pending on <sha>:followed by an empty list. The newapprovalcase in the test hits this path. It passes only because the test checks the exit code and not the output.poll's red branch: a settled red read whose confirming reads all fail now returns"deadline"with a red and an emptypending. It printsstill running, not waited for:over an empty list.
The exit codes are right in both cases. Only the text the session reads is wrong. I'll push a fix that guards both printers the way this PR guards poll's unverified branch. It also tightens the new test to check the rollup unreadable wording, which session ends soon — UNVERIFIED matched under either message, and adds a test for the red case.
|
@tend-agent The new commit clarifies the output, but the failed-confirmation path in
|
tend-agent
left a comment
There was a problem hiding this comment.
@max-sixty Confirmed. When _settle's confirming read fails, it goes back to the loop without checking the deadline. If the next read then succeeds, the top-of-loop deadline guard never runs. Your four alternating pairs followed by a complete green read currently exit 0 as green on the ninth read, past the deadline. I'm pushing a fix that checks _deadline_near() there and returns the last complete read as "deadline". That makes poll exit 2 with rollup unreadable on <sha>. The new test_failed_confirmations_at_the_session_end_hand_back_unverified drives that sequence through poll and asserts exit 2 after the second read.
A complete read followed by a failed confirmation looped back without checking the session deadline, so alternating complete and failed reads could run past it and end green. Return the last complete read as "deadline" there, as the first read's failure branch already does.
… bare 'no findings' (#1741) The review skill's check before submitting accepted "no findings" as the second pass's result. Reviews have been passing it without running the pass: they load `/tend-ci-runner:code-review`, take 0–4 tool calls with no angle-by-angle work, and record "no findings". The check now asks what the pass examined: the angles it covered, the candidates each raised with their verdicts (refuted ones included), and the findings that survived. A bare "no findings" no longer counts as running the pass. `code-review` already covers the defects these reviews missed. Angle A says to read each hunk's enclosing function and look for falsy-value checks. Angle C traces how changed code is called and what inputs it can see. Its Output section already tells the caller to report how the pass ran. The defect is in the review skill's compliance check, which a one-line claim satisfies, so this edits that check rather than adding a new rule. Validation: unvalidated by model evals so far. `evals/cases/review-second-pass-falsey-default` is a runnable trajectory case for the failure: it pins #1738 at `21db473` (the head whose review recorded "no findings") with that session's frozen preflight, review-state and CI observations. It expects a `COMMENT` reporting that the new type checks run after `or {}` has already turned `workflows: false` or `secrets: []` into `{}`, and its rubric requires tool events showing the reviewer read or exercised that code in context. `prepare.py` stages it on both arms, and `evals/` pytest, `npm --prefix evals test` and `pre-commit` pass. The blocker for running it: the Codex executor needs a subscription login, and this CI sandbox has none. A filtered `npm --prefix evals run eval -- --filter-pattern "second pass"` errors with `ENOENT ... /home/tend-sandbox/.codex/auth.json`. The Claude harness excludes trajectory cases. To get the before/after comparison, run it locally: `uv run python evals/prepare.py && npm --prefix evals run eval -- --filter-pattern "second pass"`. <details><summary>Evidence from this window's session logs</summary> Tool calls each review session made between loading `code-review` and its next step, from the JSONL logs: | Run | PR | Calls | Outcome | |---|---|---|---| | 45562114460 | #1738 at 21db473 | 0 | "The second review pass found nothing new". `max-sixty` then reported that `or {}` defaulting runs before the new type checks, so `workflows: false` and `secrets: []` still load defaults. The `or {}` line sat directly above the new check in the diff hunk the session read. | | 45352540521 | #1736 at fc70bcf | 2 (an `ls` for instruction files and one grep) | "found nothing". `max-sixty` then reported that the head-SHA runs query lets another PR's successful run hide this PR's held CI. | | 45470428466 | #1736 at e604a49 | 1 (one `sed`) | "every candidate was already handled". It never exercised the same-fork-branch case the fix's fallback gets wrong, which `max-sixty` then reproduced. | | 45473678051 | #1736 at 53ca32c | 4 | "Second pass done with no findings" | The earlier corrections on #1724 (44995176016: 2 calls) and #1730 (45126081051: 1 call) have the same shape. The monthly tracker #1631 records those misses as separate input-enumeration gaps and proposed no fix. This window's logs show they share a cause: the pass didn't run. None of these was a wrong outward action. Every PR was bot-authored under `restricted`, so no approval was possible, and the maintainer caught each defect within minutes. The same nominal pass on a human-authored PR would back an approval. </details> --------- Co-authored-by: tend-agent <[email protected]>
tend runtime poll-pr-checksnow ends its wait nearTEND_DEADLINEeven while rollup reads keep failing, and reports the commit as unverified. Before this change it waited until the harness killed the session.#1683 added the deadline exit to
_settle, but only on the branch that handles a pending rollup. Once the poll has read one complete rollup, a failed read (fetch_rollupreturningNoneon anygherror or incomplete page) loops straight back without checking the deadline. That holds both for the loop's main read and for the read that confirms a settled resultCONFIRM_SEClater. If GitHub's GraphQL stays unavailable after a read,polland the pre-approval wait inapprovalboth run until the session is killed. If the reads alternate between complete and failed,pollcan run past the deadline and still report green. That is the outcome #1524 describes, which the deadline margin exists to prevent. The caller never gets the UNVERIFIED verdict.The fix adds the deadline check to both failed-read branches. It returns the last complete read as
"deadline", and each caller already fails closed on that:pollexits 2. When the last read had nothing pending, it now printsrollup unreadable on <sha>, session ends soon — UNVERIFIED, not greeninstead of a "still pending" header over an empty list.approvalexits 2 (undecided) unless that read already held a red.The regression test
test_unreadable_rollups_at_the_session_end_hand_back_unverifiedserves one complete read, then failed reads, with the deadline inside the margin, for both commands. Before the fix both hit the test harness's sleep limit (WaitNeverEnded). With it, both exit 2.test_failed_confirmations_at_the_session_end_hand_back_unverifiedalternates four complete reads with failed confirmations, then serves a complete one. Before the fixpollreported green on the ninth read. With it,pollexits 2 after the second read. The rest oftest_poll_scripts.pypasses (103 tests), and so do the pre-commit hooks on the changed files.Refs #1524