Repository navigation
fix(test): use Gateway WebSocket transport in network fixtures - #152143
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. Reviewed September 18, 2026, 6:00 PM ET / 22:00 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR switches proxy and Gateway authentication fixtures to the existing WebSocket transport loader so Bun preserves the requested connection options. Merge readiness✅ Ready for maintainer review The fix remains useful: current main still uses the affected bare imports. No introduced correctness or security defect was found, and the prior review recorded no findings. Likely related people: steipete, supported by prior merged WebSocket transport work. Priority: P3 Review scores
Verification
How this fits togetherThese network fixtures exercise proxy routing and authenticated requests against real sockets and child Gateways. Their transport selection determines whether those checks reach the intended network and authentication behavior. flowchart TD
A[Proxy network tests] --> C[Shared test transport loader]
B[Gateway identity fixtures] --> C
C --> D[Installed WebSocket implementation]
D --> E[Proxy and loopback servers]
D --> F[Child Gateway authentication]
E --> G[Existing assertions]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +1. Total +1 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep these fixtures on the existing installed transport owner while preserving their real-network assertions. Do we have a high-confidence way to reproduce the issue? Yes, a source-supported path exists: run the affected proxy and identity fixtures under Bun, where bare ws imports select the substituted adapter. The reported before/after runs were not independently executed during this read-only review. Is this the best way to solve the issue? Yes. Reusing the established private transport entry fixes fixture selection without changing production policy, weakening assertions, or adding another implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 08f42880ba11. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
781e677 to
c2416ab
Compare
|
Merged via squash.
|
* commit 'ca69b4d25dfcd488acc6ba1d878e4b4252f40cd2': (325 commits) perf(gateway): streamline config reload comparison (#152279) fix(xai): reject invalid UTF-8 OAuth responses (#111737) fix(release): accept waived advisory performance evidence for stable publication (#152290) fix: deliver watcher results while other sessions are busy (#152287) perf(media): reuse attachment filename classification (#152274) refactor(build): reuse forwarded option scanning (#152293) chore(diagnostics-otel): revert unapproved duration-bucket merge (#152292) fix: stop chat media reads after access changes (#152219) fix(test): use Gateway WebSocket transport in network fixtures (#152143) improve: retain quota refresh evidence from successful CI runs (#152173) improve(gateway): reduce memory used by session selection (#152260) perf(agents): use keyed subagent capability lookups (#152263) refactor(matrix): centralize media metadata assembly (#149128) chore(ui): refresh control ui locales (#152276) feat: open Crabbox apps beside the conversation (#152094) refactor: simplify worker and model fallback handling (#152268) perf(codex): reconcile session catalogs incrementally (#152257) fix(ui): keep submitted prompts visible across session startup (#152241) perf(sessions): move automatic maintenance database work to workers (#148630) fix: preserve reply metadata through outbound preparation (#152231) ...
What Problem This Solves
Bun-hosted proxy and Gateway identity tests load Bun's smaller
wsadapter instead of OpenClaw's complete WebSocket transport, causing a proxy test failure and omitting the requested Origin header.User Impact
No production behavior changes. These fixtures now exercise the same installed WebSocket implementation used by the Gateway client, preserving their real network, authentication, proxy, and lifecycle assertions.
Why This Change Was Made
Route the two fixtures' runtime imports through the existing private
websocket.test-supportentry. KeepRawDataas a type-only import. No public export, dependency, authorization policy, or fallback is added.Evidence
CONTROL_UI_ORIGIN_NOT_ALLOWEDbecause its Origin header was missing.c2416abc9824f90d2b81b8a36605b0e9978971fcon fixed maind2a5196a2f951b1b100e1f7dec13d548f83aa5f4: Node26.8.2 and custom Bun1.4.3-canary.1+043813609each pass the five-file, 40-case matrix, including the real-Gateway profile/skill-library siblings and proxy transport controls. Historical pre-rebase proof also passed all four affected real-Gateway sibling cases under the prior custom Bun.promisifybindings in three SQLite tests inherited unchanged from main. This identical patch is rebased over main’s correction in fix: preserve model failure causes and worker fallback runtime #152028; this PR does not touch those files. Their complete 81-case source slice passes on Node and v14, and the complete core-test type lane passes.