Skip to content

fix(test): use Gateway WebSocket transport in network fixtures - #152143

Merged
steipete merged 1 commit into
mainfrom
codex/websocket-fixture-transport
Sep 19, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/websocket-fixture-transport

Conversation

@steipete

@steipete steipete commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Bun-hosted proxy and Gateway identity tests load Bun's smaller ws adapter 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-support entry. Keep RawData as a type-only import. No public export, dependency, authorization policy, or fallback is added.

Evidence

  • Before: the Bun external-proxy case failed inside the built-in adapter, and the real Gateway rejected a fixture connection with CONTROL_UI_ORIGIN_NOT_ALLOWED because its Origin header was missing.
  • Fresh candidate c2416abc9824f90d2b81b8a36605b0e9978971fc on fixed main d2a5196a2f951b1b100e1f7dec13d548f83aa5f4: Node26.8.2 and custom Bun 1.4.3-canary.1+043813609 each 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.
  • The previous CI merge failed on duplicate promisify bindings 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.
  • The exact-source private-QA build, owned frozen dependencies, changed-file checks, and fresh independent P0–P2 review pass. Actual child runtimes and cleanup were verified.
  • Assertions, deadlines, proxy routing rules, Origin checks, and authentication remain unchanged.

@clawsweeper

clawsweeper Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 18, 2026
@steipete
steipete marked this pull request as ready for review September 18, 2026 20:27
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 18, 2026
@clawsweeper

clawsweeper Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 6:00 PM ET / 22:00 UTC (Revision 2).

ClawSweeper review

What this changes

The 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
Reviewed head: c2416abc9824f90d2b81b8a36605b0e9978971fc

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, maintainable fixture repair with relevant reported validation and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies maintainer-authored work, so the external-contributor gate does not apply. The body reports after-fix Node/Bun proxy and real child-Gateway runs through the changed fixtures; this review did not execute them.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies maintainer-authored work, so the external-contributor gate does not apply. The body reports after-fix Node/Bun proxy and real child-Gateway runs through the changed fixtures; this review did not execute them.
Evidence reviewed 7 items Introduced patch scope: The pinned merge-base-to-head diff changes only runtime WebSocket imports and retains RawData as a type-only import. Assertions, deadlines, proxy policy, authentication inputs, dependencies, and public exports are unchanged.
Existing transport owner: The private test-support entry reexports the existing package-owned loader, which resolves installed ws implementation files to avoid Bun's substituted adapter. The production Gateway client already imports that loader; no competing transport implementation is added.
Current main still needs the fixture correction: Fetched main still imports WebSocketServer and the child-process WebSocket directly from ws in the proxy test; the identity fixture also retains its bare runtime import. The latest release's proxy test likewise retains these imports.
Findings None None.
Security None None.

How this fits together

These 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
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +1. Total +1 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 4 3 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 4 3 +1

Review metrics

None.

Technical review

Best 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.

Labels

Label justifications:

  • P3: This repairs internal test transport selection without changing shipped runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies maintainer-authored work, so the external-contributor gate does not apply. The body reports after-fix Node/Bun proxy and real child-Gateway runs through the changed fixtures; this review did not execute them.

Evidence

What I checked:

  • Introduced patch scope: The pinned merge-base-to-head diff changes only runtime WebSocket imports and retains RawData as a type-only import. Assertions, deadlines, proxy policy, authentication inputs, dependencies, and public exports are unchanged. (src/infra/net/proxy/external-proxy.e2e.test.ts:11, c2416abc9824)
  • Existing transport owner: The private test-support entry reexports the existing package-owned loader, which resolves installed ws implementation files to avoid Bun's substituted adapter. The production Gateway client already imports that loader; no competing transport implementation is added. (packages/gateway-client/src/websocket.ts:4, c2416abc9824)
  • Current main still needs the fixture correction: Fetched main still imports WebSocketServer and the child-process WebSocket directly from ws in the proxy test; the identity fixture also retains its bare runtime import. The latest release's proxy test likewise retains these imports. (src/infra/net/proxy/external-proxy.e2e.test.ts:11, 08f42880ba11)
  • Transport history and related work: Git history and GitHub commit metadata connect the existing transport approach to merged fix(gateway-client): preserve WebSocket options under Bun #139919 and prior work by steipete. That PR established the reusable transport but did not convert these remaining fixtures. (packages/gateway-client/src/websocket.ts, 56924648b69b)
  • Retained boundary coverage: The identity fixture supplies Origin and proxy identity headers to an actual WebSocket connection. Its consumer retains scope-cap and cross-user denial assertions; existing Gateway client coverage independently checks the received Origin header. (test/e2e/qa-lab/runtime/skill-library-wire-fixture.ts:91, c2416abc9824)
  • Captured validation and review continuity: The supplied body reports a fresh five-file, 40-case matrix passing on Node 26.8.2 and custom Bun at the reviewed head, including real child-Gateway and proxy cases. These are contributor-reported results, not reviewer executions. The previous completed review had no findings or published rank-up moves. Local comparison with its older head was unavailable; no unchanged-code attribution is made. (c2416abc9824)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-18T20:33:42.180Z sha 781e677 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/websocket-fixture-transport branch from 781e677 to c2416ab Compare September 18, 2026 21:54
@steipete
steipete merged commit 249d17a into main Sep 19, 2026
282 of 286 checks passed
@steipete
steipete deleted the codex/websocket-fixture-transport branch September 19, 2026 00:18
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 19, 2026
* 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)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant