Repository navigation
test(gateway): wait for both queued recovery inputs - #136473
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 1:34 PM ET / 17:34 UTC. ClawSweeper reviewWhat this changesThe PR updates the Gateway startup-recovery WebChat integration test to wait for both submitted queue entries, including one active and one pending entry, before releasing recovery. Merge readiness✅ Ready for maintainer review Keep open: current main still uses the one-item recovery barrier, while this focused test-only patch verifies both queued browser inputs before recovery proceeds. The strengthened assertions match the queue’s documented active-item semantics; no introduced correctness or security defect was found. Priority: P3 Review scores
Verification
How this fits togetherWebChat requests enter the Gateway’s follow-up queue while startup recovery holds the session’s work admission. The queue retains active deliveries in its item list, and recovery resumes processing once the replacement owner releases the barrier. flowchart LR
A[WebChat requests] --> B[Gateway chat handling]
B --> C[Follow-up queue]
C --> D[Startup recovery barrier]
D --> E[Replacement session owner]
E --> F[Queued survivor executes]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +8. Total +8 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Merge the focused test repair after normal exact-head CI, retaining the queue’s canonical active-versus-pending accounting rather than restoring the one-item proxy assertion. Do we have a high-confidence way to reproduce the issue? Yes: the supplied CI failure and current-main one-item barrier align with the queue contract showing that an active source remains in items; the reviewer did not execute the test because this review checkout is read-only. Is this the best way to solve the issue? Yes: asserting the two submitted identities plus separate active and pending counts directly protects the intended recovery precondition without changing production behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8c60cc9d2ca9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Keep the stronger queue identity and pending-depth assertions from #136473. The remaining CI optimization and shared test fixes are unchanged.
Reuse the gateway CLI fixture cleanup from #136469 (667ce2b) and the landed startup-recovery queue assertions from #136473 (564e544). These address independent lint and shared-worker test failures while preserving all process, state, cancellation, and survivor assertions. Keep Vincent Koc's scanner implementation and original PR ancestry unchanged. The new commit also refreshes pull-request CI against main's authenticated checkout repair from #136178.
Remove the temporary copies of the CLI fixture and startup queue test fixes. Main now owns the CLI suite split in aef65cc and queue assertions in #136473. Keeping the earlier fixture cleanup here conflicts with main's new shared test support and health suite. Restore the cumulative PR tree exactly to Vincent Koc's reviewed 4a35cef without replacing his ancestry. The merge then retains main's canonical test repairs and authenticated checkout fix from #136178.
What Problem This Solves
The startup-recovery WebChat test could advance before both browser turns reached the queue. An active source remains in
items, so one item and oneinFlightentry can refer to the same object. The intended two-source state could also fail the old one-item assertion.Why This Change Was Made
Wait for the exact two ID/prompt pairs, one active source, one pending source through the existing queue helper, and the unchanged recovery-provider request count before releasing recovery. The same map supplies the submitted messages and expected queue contents. Production code, deadlines, cancellation, and survivor-once assertions are unchanged.
User Impact
This makes the existing recovery integration test verify its intended precondition and removes a race in CI. Production LOC is unchanged; test LOC is +8. No runtime performance or memory claim is made.
Evidence
The original Linux CI assertion failure is retained in the failed recovery test job. A fresh unchanged local Gateway run passed; a separate read-only identity capture showed that it advanced with just one unique source. The corrected canonical Gateway run and identity capture both passed with the two exact sources retained under the original recovery owner. This is a local reproduction of the premature barrier, not a claimed repeat of the Linux assertion failure.
The real ephemeral Gateway, authenticated WebSocket client, and embedded dispatch ran against a synthetic localhost Responses provider. All 15 queue-helper tests and the full changed gate passed. Independent managed Codex P0–P2 review completed with no findings. Owned processes joined and private runtime state was removed. Local proof used macOS/Node 26; no Windows execution, statistical flake-rate estimate, or real provider call is claimed.
Reviewed test SHA-256:
d19570aa26620198236b6f18a977add371b563b486beacacd4b533779a4e4c05.