Repository navigation
fix(test): report chat RPC failures without stray rejections - #201985
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR observes the event waiter alongside the chat RPC assertion and includes RPC error details in assertion failures. Example: chat.send returns INVALID_REQUEST during ownerTurn.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: the focused waiter repair preserves the existing assertions and improves failure diagnostics; the remaining CI admission refusal is not established as patch-caused. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway integration test sends WebSocket RPCs and observes session events to verify subscription visibility across sharing and role changes. flowchart LR
A[Visibility integration test] --> B[ownerTurn]
B --> C[chat.send RPC]
B --> D[Session event waiter]
C --> E[Promise.all]
D --> E
E --> F[Visibility assertions]
Technical reviewBest possible solution: Retain this local Promise.all repair and keep production session-admission changes with their existing owner. Do we have a high-confidence way to reproduce the issue? Current-main control flow and historical CI annotations establish the abandoned waiter failure; the PR reports an invalid-message before/after experiment, but no target code was executed during this review. Is this the best way to solve the issue? The change is the smallest complete caller repair: register the event listener first, observe both promises immediately, preserve RPC failure details, and leave shared helpers and authorization checks unchanged. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2420b7db04c7. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +4. Total +4 across 1 file. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 19, 2026, 1:33 PM ET / 18:33 UTC. |
Baseline-Refresh: 0fe6bc2d7e36dfffdebd213714572986d0bd4d81
|
Merged via squash auto-merge.
|
Fixes #201963
What Problem This Solves
When a chat RPC fails in the main-session subscription test, the assertion hides its error details and leaves the event waiter unobserved. Fixture cleanup can then add an unrelated unhandled WebSocket rejection to the failure.
User Impact
No user-visible change. Developers get the failed RPC's details without a second unhandled rejection from this test.
Why This Change Was Made
Observe the event waiter and RPC assertion together, while registering the listener before sending. All existing authorization and visibility assertions remain intact.
This repairs test failure handling. The separate production admission fix, #201790, has merged and is included in the refreshed baseline.
Evidence
chat.sendmessage through the real Gateway fixture on Linux with the repository's pinned Bun runtime. The original code failed its assertion and produced one unhandled WebSocket-close rejection. The patched code failed only its assertion, with theINVALID_REQUESTdetails visible.UNAVAILABLE: Session actor turn was refused by its current owner. One diagnostic replay preserving the original wait order passed 2/2. Those passes do not establish that the intermittent refusal is fixed or that timing is irrelevant. The refusal originates in production session-actor admission; the exact rejected guard remains unproven.cd2ae19272a3ee7be456385fa7efc56d6e2109a6..2f23b19caddf73e5f76384ad871bbefdb25dbdfb, priorities P0–P3: complete, scoped-clean, no findings. Local ClawSweeper was unavailable; the maintainer fallback route is used.8a1c43e37a99bf7b5308c918a747cbe80b5c256bpreserves the merged production fix and changes only the same test waiter block. The candidate file is byte-identical to the previously reviewed and tested patch; independent exact-candidate source review passed. The full target test passed 2/2 in the Gateway CI job, and CI run 44675264741 succeeded for this head. The tested merge checkout wasc9aef378aff4fc052e03787f59ce145c60d93eee. These results qualify this patch; they do not establish that every intermittent production refusal is fixed.