| β¦ | β¦ | @@ -44,23 +48,58 @@ export function evaluatePullRequestWatch( | |
| 94 | + | ), | |
| 95 | + | ]; | |
| 96 | + | } | |
| 97 | + | if (detail.checks.length > 0 && !unread) { | |
π‘ Medium orchestration-v2/pullRequestWatch.ts:97
After passed is set by a successful gate, a read containing a real gate failure or pending gate check alongside a placeholder leaves passed true; when the gate later recovers, no checks-passed change is emitted, so the thread is never woken for recovery. The !unread guard skips all gate-state updates for that read; clear passed and passedChecks when the observed gate is failed or pending, while still preserving uncertainty about the placeholder.
| 1 | + if (unread) { |
| 2 | + const required = detail.checks.filter((check) => check.required === true); |
| 3 | + const gate = required.length > 0 ? required : detail.checks; |
| 4 | + if (gate.some((check) => check.status === "pending" || isFailedCheck(check))) { |
| 5 | + passed = false; |
| 6 | + passedChecks = []; |
| 7 | + } |
| 8 | + } |
π Reply "fix it for me" or copy this AI Prompt for your agent:
| 1 | In file @apps/server/src/orchestration-v2/pullRequestWatch.ts around line 97: |
| 2 | |
| 3 | After `passed` is set by a successful gate, a read containing a real gate failure or pending gate check alongside a placeholder leaves `passed` true; when the gate later recovers, no `checks-passed` change is emitted, so the thread is never woken for recovery. The `!unread` guard skips all gate-state updates for that read; clear `passed` and `passedChecks` when the observed gate is failed or pending, while still preserving uncertainty about the placeholder. |
[gpt-6.1-sol][Codex] on behalf of shivam.
Fixed in 5f30a39eaf, included in 4304491266. An unread approval response now prevents confirming a pass, while an observed failed or pending gate check, or any real approval, clears the previous pass. Red-first coverage verifies failure and pending recovery each wake once, real approvals block passing, and positive-only unread reads preserve owed checks. The evaluator transcript confirms failure plus placeholder clears passed, then recovery emits checks-passed. Final-commit Boat job j_tw4hethmfjxipsdlpf7a passed check:changed with 161 tests; independent review found no code blockers.