Repository navigation
chore: speed up Gateway session test fixtures - #118581
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 4:39 AM ET / 08:39 UTC. ClawSweeper reviewWhat this changesThe branch adds a handler-only Gateway session fixture and migrates direct-handler tests to it, so they retain shared state setup without starting an unused loopback WebSocket server. Merge readinessThis PR remains necessary: current Priority: P3 Review scores
Verification
How this fits togetherGateway session tests share fixture setup for configuration, state directories, mocks, and optional loopback server transport. Direct handler tests call the Gateway request-handler surface directly, while transport tests retain a running server and authenticated WebSocket clients. flowchart LR
A[Gateway session test] --> B{Test uses transport client?}
B -->|No| C[Handler-only fixture]
B -->|Yes| D[Server-backed fixture]
C --> E[Shared state, config, and mocks]
D --> E
D --> F[Loopback Gateway server]
E --> G[Session handler assertions]
F --> H[WebSocket and client assertions]
Decision needed
Why: The source boundary and reported after-fix benchmark support the design, but the protected Before merge
Agent review detailsSecurityNone. PR surfaceSource +15, Tests 0. Total +15 across 18 files. View PR surface stats
Review metrics
Merge-risk options
Maintainer options:
Technical reviewBest possible solution: Keep one shared fixture with explicit handler-only and server-backed entry points, retain real transport suites on the eager-server path, and merge after exact-head CI establishes that the measured test-speed improvement does not regress the retained transport coverage. Do we have a high-confidence way to reproduce the issue? Not applicable: the requested outcome is a faster test fixture, and the PR body supplies an after-fix same-host benchmark plus retained test-count evidence rather than a user-facing bug reproduction. Is this the best way to solve the issue? Yes: separating handler-only setup from the server-backed fixture is the narrowest maintainable boundary because the common state lifecycle stays canonical while transport suites keep their real server coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0cad02313a9c. 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
|
|
Merged via squash.
|
…ion-routing * origin/main: refactor(agents): remove stale runner state plumbing (#118495) test(gateway): skip servers for handler fixtures (#118581) test(tui): reuse real gateway PTY fixture (#118567) fix: keep command tests independent of ambient Gateway tokens (#118577) fix: show effective channel model in Telegram status (#118548) test(system-agent): reuse approval CLI fixture (#118572) test(macos): deduplicate Claude session catalog fixtures (#118571)
Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
The Gateway agent/chat test group starts a real WebSocket server and loads its transport graph in session test files that call handlers directly and never use the server. This redundant fixture work keeps a critical CI shard above its target runtime.
Why This Change Was Made
The shared sessions fixture now has explicit handler-only and server-backed entry points. Seventeen direct-handler files use the lightweight entry point; all ten suites with real client or WebSocket assertions keep the existing eager server lifecycle. Server transport and transcript-owner modules are loaded only when their fixture functions need them.
This is test-only. It changes no production behavior, test sharding, concurrency, assertions, or state-isolation policy.
User Impact
No user-visible behavior changes. Maintainers get a faster Gateway test shard while retaining every direct handler and real transport assertion.
Evidence
agentic-control-plane-agent-chatgroup: 159.83s baseline, 140.50-140.71s after on the same host, saving 19.1-19.3s.blacksmithCLI is not installed, so exact-head PR CI is the hosted broad proof.