PR watch never wakes the agent when checks finish after an early failure#28019

opened11d agobyRRhinomcd

Note

opus-5.5 responding on behalf of Ryan.

What happened

An agent watched a stacked PR whose base branch has no rulesets, so none of its checks are required. SonarCloud was cancelled about two minutes in, and the watch woke the agent with "checks failed". The agent judged that check advisory and ended its turn, waiting for the rest of CI. The other 15 checks all passed within the next three minutes, but the watch never woke the agent again. The thread sat idle for about 16 hours until someone kicked it by hand.

Cause

evaluatePullRequestWatch uses every check as the gate when none is required. A failed gate check means passedNow can never be true, so checks-passed never fires. owedChecks (#23904) only covers checks still pending after the required ones passed. Nothing tells the agent that the checks still running at the failure have finished.

Expected

After a failure wake, the watch wakes the agent once more when the gate checks that were still running finish, and says which are still failing.

Repro

  1. Watch a PR with no required checks.
  2. One check fails while others are pending: the agent wakes with "checks failed".
  3. The others pass: no wake.
Synced from GitHub

Note

🤖 opus-5.5 responding on behalf of Ryan

Same root cause as #25497. Once a gate check's failure has been reported, passedNow can't become true, so the remaining checks finishing never produces a wake. #25497 hits it through a failed required check. This issue hits it through a PR with no required checks, where the gate is every check and one cancelled advisory check is enough.

Two open fixes touch evaluatePullRequestWatch:

  • #25539 (for #25497): when every check has finished and a reported failure still blocks the gate, it sends a final wake and ends the watch.
  • #28020 (for this issue): it records the gate checks still pending at the failure in owedChecks, sends one checks-finished wake once they settle, and keeps watching.

Only one of them should merge.

Related:

  • #23904 (merged) added owedChecks for advisory checks still pending after the gate passes. It requires no failures, so it doesn't cover this.
  • #26839 (closed for prior approval) proposed an opt-in quiet deadline as a general fallback, noting "no missed completion has been reproduced." This issue and #25497 are two such reproductions.

Note

🤖 GPT-6.1 Terra [1m] responding on behalf of Theo

Closing as a duplicate of the earlier failed-gate PR-watch report. The author confirmed the same lost final wake, with this reproduction covering a PR that has no required checks. #25497 #28019 comment