Skip to content

test: exercise OpenClaw fixtures under Bun - #149699

Merged
clawsweeper[bot] merged 1 commit into
mainfrom
codex/bun-test-portability-round3
Sep 16, 2026
Merged

clawsweeper[bot] merged 1 commit into
mainfrom
codex/bun-test-portability-round3

Conversation

@steipete

@steipete steipete commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Direct Bun runs fail in otherwise valid OpenClaw tests because several fixtures depend on Node-only loader aliases, async-hooks resource names, mutable process fields, or node-pty callbacks in the parent process.

User Impact

User impact: there is no product behavior change; maintainers can run these Gateway, cron, logging, TLS, and onboarding tests directly under Bun without hiding their original assertions.

Why This Change Was Made

Gateway fixtures now load the maintained WebSocket implementation below Bun's built-in alias. The Control UI test counts the exact descriptor read and rejects extra callback metadata reads. Event-loop tests retain tight half-millisecond bounds across Node's histogram quantization and Bun's exact values. Cron cases close their own SQLite resources, and CPU-profile mocks isolate the Node inspector path while retaining an explicit Bun-unsupported case.

The onboarding PTY driver runs under Node because oven-sh/bun#25822 prevents node-pty data callbacks in a Bun parent, but it still launches process.execPath, so a Bun suite exercises the Bun onboarding child. This adds no dependency and does not change Node installation behavior.

Evidence

  • Rebased head, signed custom Bun: 342 passing assertions and one expected Node-only profiler skip across the affected files.
  • Rebased head, Node: 343 passing assertions across the same files.
  • The earlier full 264-test Gateway aggregate passed under both runtimes; TLS, cron, logging, onboarding, event-loop, and metadata-read files also passed independently.
  • Full changed-file gate and independent P0-P2 review passed on the rebased head.

@clawsweeper

clawsweeper Bot commented Sep 16, 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.

@steipete
steipete marked this pull request as ready for review September 16, 2026 04:48
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper approve

@steipete
steipete requested a review from a team as a code owner September 16, 2026 04:48
@clawsweeper

clawsweeper Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: M maintainer Maintainer-authored PR labels Sep 16, 2026
@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 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed. Reviewed September 16, 2026, 3:34 AM ET / 07:34 UTC (Revision 3).

ClawSweeper review

What this changes

Updates Gateway, TLS, cron, logging, and onboarding test fixtures to run under Bun while retaining their behavioral checks.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains useful fixture-portability work absent from current main. No blocking correctness or security finding emerged, and the prior review contains no unresolved findings.

Priority: P3
Reviewed head: aa5de744475189ee250a6427a6d8ab1ba5d76f86

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused fixture-portability patch with preserved behavioral assertions and reported dual-runtime validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies maintainer authorship, so the external-contributor proof gate does not apply. Reported Node/Bun fixture runs cover the changed test setup; no production authority boundary changes.
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 authorship, so the external-contributor proof gate does not apply. Reported Node/Bun fixture runs cover the changed test setup; no production authority boundary changes.
Evidence reviewed 7 items Current-main necessity: Current main still runs node-pty directly in the test parent. Comparison of all introduced paths shows that the fixture changes remain distinct from fetched main.
Onboarding assertion preservation: The Node driver receives process.execPath from the suite, launches that runtime in a PTY, sends Ctrl-D after the prompt, and returns output and exit information. The test still requires cancellation exit code 1 and rejects unsettled top-level await output.
TLS coverage retained: Removing the successful connection’s raw-byte assertion leaves successful upgrade and credential-header assertions intact. Wrong-pin and untrusted-certificate cases still require zero HTTP bytes and zero upgrades.
Findings None None.
Security None None.

How this fits together

These fixtures exercise OpenClaw’s networking, scheduling, diagnostics, and onboarding behavior. They translate runtime-specific setup into assertions used by developers and CI.

flowchart TD
  A[Node or Bun test runner] --> B[Portable test fixtures]
  B --> C[Maintained WebSocket implementation]
  B --> D[Isolated state and diagnostics]
  B --> E[Node PTY driver]
  E --> F[Onboarding child in selected runtime]
  C --> G[Behavior assertions]
  D --> G
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +57, Tests +4. Total +61 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 3 62 5 +57
Tests 12 108 104 +4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 170 109 +61

Review metrics

Metric Value Why it matters
Production versus test growth Production +0; tests and test support net +61 lines Growth stays in fixture portability, including the extracted PTY driver, without expanding production behavior.

Technical review

Best possible solution:

Keep runtime differences in test setup, reuse the maintained networking loader, and preserve cancellation, cleanup, and rejection assertions across Node and Bun.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a product bug: this is test-fixture portability work. The supplied dual-runtime results were reviewed, but tests were not executed during this read-only review.

Is this the best way to solve the issue?

Yes: the changes reuse existing runtime and cleanup owners while preserving meaningful assertions; the Node PTY parent still exercises the selected runtime in its child.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against f000b487300b.

Labels

Label changes:

  • add status: 🚀 automerge armed: This PR is in ClawSweeper's automerge lane. Not applicable: The supplied repository state identifies maintainer authorship, so the external-contributor proof gate does not apply. Reported Node/Bun fixture runs cover the changed test setup; no production authority boundary changes.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: 🚀 automerge armed.

Label justifications:

  • P3: This improves developer test portability without changing user-facing runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 🚀 automerge armed: This PR is in ClawSweeper's automerge lane. Not applicable: The supplied repository state identifies maintainer authorship, so the external-contributor proof gate does not apply. Reported Node/Bun fixture runs cover the changed test setup; no production authority boundary changes.

Evidence

What I checked:

  • Current-main necessity: Current main still runs node-pty directly in the test parent. Comparison of all introduced paths shows that the fixture changes remain distinct from fetched main. (src/wizard/clack-prompter.process.test.ts:4, f000b487300b)
  • Onboarding assertion preservation: The Node driver receives process.execPath from the suite, launches that runtime in a PTY, sends Ctrl-D after the prompt, and returns output and exit information. The test still requires cancellation exit code 1 and rejects unsettled top-level await output. (src/wizard/clack-prompter.process.test.ts:26, aa5de7444751)
  • TLS coverage retained: Removing the successful connection’s raw-byte assertion leaves successful upgrade and credential-header assertions intact. Wrong-pin and untrusted-certificate cases still require zero HTTP bytes and zero upgrades. (packages/gateway-client/src/client.tls.test.ts:143, aa5de7444751)
  • Existing loader and related merged work: The maintained loader resolves ws beneath Bun’s package alias. GitHub confirms fix: restore plugin networking under Bun #147421 merged on September 14; it provides the networking foundation rather than superseding these fixture changes. (packages/gateway-client/src/websocket.ts:4, f8b194a5beda)
  • Area history: Current-main history connects Peter Steinberger to the Bun WebSocket loader and recent diagnostics fixes. Some deeper historical blobs were unavailable, so no source-line introduction attribution is asserted. (packages/gateway-client/src/websocket.ts, f000b487300b)
  • Validation and review continuity: The supplied PR body reports 343 passing assertions on Node and 342 plus one expected profiler skip on custom Bun. The prior completed review assessed the identical head and recorded no findings. These are supplied validation results, not reviewer-executed tests. (aa5de7444751)

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 (2 earlier review cycles)
  • reviewed 2026-09-16T04:54:08.087Z sha 5086d9c86a902cd839f17bbc9e2a32fe76b1aa15 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-16T07:04:16.856Z sha aa5de74 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/bun-test-portability-round3 branch from 5086d9c to aa5de74 Compare September 16, 2026 06:55
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper approve

@clawsweeper

clawsweeper Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper automerge

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞✅
ClawSweeper merged this PR after the passing review.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper verdict: pass (sha=aa5de744475189ee250a6427a6d8ab1ba5d76f86)
Merge status: merged by ClawSweeper automerge
Merged at: 2026-09-16T07:37:19Z
Merge commit: dcb724224aed

What merged:

  • Updates Gateway, TLS, cron, logging, and onboarding test fixtures to run under Bun while retaining their behavioral checks.

Automerge notes:

  • No ClawSweeper repair was needed after automerge opt-in.

The automerge loop is complete.

Automerge progress:

  • 2026-09-16 07:29:19 UTC review queued aa5de7444751 (queued)
  • 2026-09-16 07:35:19 UTC review passed aa5de7444751 (structured ClawSweeper verdict: pass (sha=aa5de744475189ee250a6427a6d8ab1ba5d...)
  • 2026-09-16 07:37:22 UTC merged aa5de7444751 (merged by ClawSweeper automerge)

@clawsweeper clawsweeper Bot added clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 16, 2026
@clawsweeper
clawsweeper Bot merged commit dcb7242 into main Sep 16, 2026
249 of 253 checks passed
@clawsweeper
clawsweeper Bot deleted the codex/bun-test-portability-round3 branch September 16, 2026 07:37
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
Summary:
- Updates Gateway, TLS, cron, logging, and onboarding test fixtures to run under Bun while retaining their behavioral checks.

Automerge notes:
- No ClawSweeper repair was needed after automerge opt-in.

Validation:
- ClawSweeper review passed for head aa5de74.
- Required merge gates passed before the squash merge.

Prepared head SHA: aa5de74
Review: openclaw#149699 (comment)

Co-authored-by: Peter Steinberger <[email protected]>
Approved-by: steipete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge gateway Gateway runtime 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: M status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant