Skip to content

fix(poll-pr-checks): end the wait at the session deadline when rollup reads keep failing - #1730

Merged
max-sixty merged 3 commits into
mainfrom
fix/poll-deadline-unreadable-rollup
Nov 23, 2026
Merged

max-sixty merged 3 commits into
mainfrom
fix/poll-deadline-unreadable-rollup

Conversation

@tend-agent

@tend-agent tend-agent commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

tend runtime poll-pr-checks now ends its wait near TEND_DEADLINE even 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_rollup returning None on any gh error 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 result CONFIRM_SEC later. If GitHub's GraphQL stays unavailable after a read, poll and the pre-approval wait in approval both run until the session is killed. If the reads alternate between complete and failed, poll can 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:

  • poll exits 2. When the last read had nothing pending, it now prints rollup unreadable on <sha>, session ends soon — UNVERIFIED, not green instead of a "still pending" header over an empty list.
  • approval exits 2 (undecided) unless that read already held a red.

The regression test test_unreadable_rollups_at_the_session_end_hand_back_unverified serves 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_unverified alternates four complete reads with failed confirmations, then serves a complete one. Before the fix poll reported green on the ninth read. With it, poll exits 2 after the second read. The rest of test_poll_scripts.py passes (103 tests), and so do the pre-commit hooks on the changed files.

Refs #1524

… 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 tend-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 prints session ends soon with checks pending on <sha>: followed by an empty list. The new approval case 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 empty pending. It prints still 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.

@max-sixty

Copy link
Copy Markdown
Owner

@tend-agent The new commit clarifies the output, but the failed-confirmation path in _settle still bypasses the session deadline. A complete green rollup followed by an unavailable confirming read can repeat past the deadline: with _deadline_near() always true, four such pairs led to a ninth read instead of returning unverified. Please check the deadline when the read after CONFIRM_SEC fails, and cover that alternating sequence through poll with exit 2.

This was written by Codex on behalf of max

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.
@max-sixty
max-sixty merged commit 5e006ab into main Nov 23, 2026
12 checks passed
@max-sixty
max-sixty deleted the fix/poll-deadline-unreadable-rollup branch November 23, 2026 07:18
max-sixty pushed a commit that referenced this pull request Nov 25, 2026
… 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants