Repository navigation
test(gateway): prove RPC wire and agent contracts - #118794
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 5:13 PM ET / 21:13 UTC. ClawSweeper reviewWhat this changesAdds two real-Gateway WebSocket contract tests and two runtime QA scenarios covering RPC envelopes, discovery, per-client heartbeat order, best-effort delivery fallback, accepted/final response order, and reconnect idempotency. Merge readinessThis PR remains necessary as a focused QA-evidence addition. The earlier duplicate-coverage concern is resolved by the explicit member decision to retain one cohesive real-Gateway lifecycle scenario for the three catalog targets, while current main continues to own the broader behavioral regressions; the patch introduces no production behavior change or concrete correctness finding. Final merge should wait for the behind-branch merge result and in-progress required checks to refresh. Priority: P3 Review scores
Verification
How this fits togetherGateway accepts WebSocket RPC requests, resolves delivery and agent execution, then emits response and event frames to connected clients. The added tests exercise that live loopback boundary and register the resulting evidence in the QA scenario catalog. flowchart LR
Client[WebSocket clients] --> Gateway[Gateway server]
Gateway --> Handshake[Handshake and RPC envelopes]
Gateway --> Delivery[Delivery resolution]
Delivery --> AgentRun[Agent execution]
AgentRun --> Responses[Accepted and final responses]
Gateway --> Events[Heartbeat event broadcast]
Responses --> Client
Events --> Client
Before merge
Agent review detailsSecurityNone. PR surfaceTests +321, Other +57. Total +378 across 4 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the two focused tests and their QA records after the branch is refreshed against current main and required checks confirm the exact merge result; retain the broader agent suite as the behavioral regression owner. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds executable regression and QA evidence rather than fixing a newly reported runtime defect. The PR body reports focused real-Gateway runs, and the source directly shows the loopback WebSocket path under test. Is this the best way to solve the issue? Yes: keeping the focused lifecycle test while preserving the existing broad suite follows the explicitly approved evidence-owner split and avoids changing production routing or duplicating a second runtime implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5b1b1e063225. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
Maintainer decision: retain the separate agent RPC scenario as the canonical QA
The existing broad Gateway suite remains the behavioral regression owner for The response-ordering finding is fixed in |
f10e0dd to
ce5f09f
Compare
ce5f09f to
25b820c
Compare
|
Rank-up move disposition:
|
|
@clawsweeper automerge |
|
🦞🧹 Reason: automerge requires an open PR. Draft PRs stay fix-only until GitHub marks them ready for review. Pause with Automerge progress:
|
* test(gateway): cover RPC wire contracts * test(gateway): cover agent RPC contracts * test(gateway): satisfy heartbeat type safety * test(gateway): satisfy agent RPC lint * test(gateway): assert agent response ordering
What Problem This Solves
Gateway QA coverage did not directly exercise seven RPC/event contracts at the
real WebSocket boundary: frame envelopes, method/event discovery, per-client
event ordering, delivery fallback, accepted/final responses, and idempotent
replay.
Why This Change Was Made
This adds two focused real-Gateway WebSocket scenarios. The wire scenario uses
two clients to validate handshake and health envelopes, hello discovery
metadata, and monotonic heartbeat sequences. The agent scenario validates
session-only fallback, accepted/final ordering, and reconnect replay while
mocking only the downstream provider command.
No production code, taxonomy, QA internals, or existing broad tests are changed.
User Impact
No runtime behavior changes. Maintainers gain executable primary evidence for
seven existing Gateway maturity targets.
Review Disposition
exact
accepted, thenokframe order for the request ID.evidence owner for three exact maturity IDs: one real Gateway lifecycle
proves fallback, ordered responses, and reconnect replay while mocking only
downstream
agentCommand. Existing broad tests cover those behaviorsseparately; they do not provide this single catalog evidence unit.
Repair Doctrine
evidence for these seven existing contracts.
metadata.
agent-lifecycle ownership.
+0.+378lines across two tests and two scenarios.agent path proves fallback, ordered terminal results, reconnect replay, and
one downstream side effect.
Evidence
origin/main682f60ce56b37c5cd3205fdcbbf25b21d48708f2, which contains securityprerequisite
25aa29d7a15ed6402543fe48680853d7637f2b36.25b820c3b46e2ac952439783a8a731ca3a78f673.cbx_19fb48ce19cdrun_e8f0c2496053src/gateway/server.rpc-wire-contracts.test.ts: passedsrc/gateway/server.agent.rpc-contracts.test.ts: passedtbx_01kz4pdhhq8dss6x0znyj4e8p5: formatting, repository guards, fulltsgotypecheck, full lint, and runtime import-cycle checks all passed.gateway-rpc-wire-contracts: four exact primary IDsgateway-agent-rpc-contracts: three exact primary IDsscenario.
git diff --check: passed.score
0.99.