Repository navigation
fix(runtime): support Bun across tooling suite - #146807
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: blocked before merge. Reviewed September 13, 2026, 5:59 AM ET / 09:59 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch adapts tooling subprocesses, Gateway WebSockets, release-plan serialization, and test fixtures to run under Bun while retaining Node for Node-specific operations. Merge readiness⛔ Blocked before merge - 6 items remain This remains useful work not covered by current main. The two prior release-bootstrap findings are resolved, but the previously reported Bun timeout-control bug remains. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s tooling launches build, validation, and release subprocesses, while the Gateway uses WebSockets for client and desktop connections. These adapters preserve their transport and process-lifecycle contracts across Node and Bun. flowchart TD
A[Build and validation requests] --> B[Runtime selection]
B --> C[Node-owned subprocesses]
C --> D[Output and timeout handling]
E[Gateway connections] --> F[Installed WebSocket transport]
F --> G[Client and desktop streams]
Before merge
Findings
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the shared runtime adapters and make control-record framing independent of child stderr formatting, preserving identical timeout and output contracts under Node and Bun. Do we have a high-confidence way to reproduce the issue? Yes, from source: under Bun, run a checked timed child that writes stderr without a newline and then stalls. The timeout marker joins that text and is missed; this review did not execute the scenario. Is this the best way to solve the issue? The overall approach fits the existing runtime owners, but the stderr framing must be corrected before the patch preserves the established timeout contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0d1cf24318b8. 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 (3 earlier review cycles)
|
3c4d569 to
8b695a4
Compare
|
Merged via squash.
|
* refs/heads/temp/pr-146883: (159 commits) fix: retain route ownership while discovering conversations (#146927) refactor: reuse plugin fixture shell runner (#146920) fix(worker): stop preparing disabled live previews (#146896) fix(runtime): support Bun across tooling suite (#146807) chore(i18n): refresh native locales (#146924) perf(secrets): limit expiry metadata to transient credentials (#146882) fix(ui): preserve queued refreshes during session discovery (#146535) test(ui): wait for quiet scrolling and close named file tabs (#146836) fix(ui): prevent Usage hour filters from freezing during DST (#146919) test(ui): share browser page cleanup across layout fixtures (#146805) ci: balance complete PR runtime test groups (#146916) improve(infra): reduce scheduling work for session notice bursts (#146818) improve: prepare Gateway skill commands asynchronously (#146812) improve(agents): skip unused assistant delivery parsing (#146858) improve(ui): reuse date formatters across timestamp lists (#146789) fix(tests): isolate installer and Docker shell snippets (#146897) test(heartbeat): share explicit channel configuration fixtures (#146853) fix: retain conversation reply claims through write admission (#146866) perf(sessions): bound history reads and stabilize cursor paging (#146770) fix(ui): let slow dashboard downloads finish before recovery (#146881) ...
* refs/heads/temp/pr-146833: (43 commits) fix(memory): preserve newer indexes and disclose automatic rebuild costs (#146908) fix: retain route ownership while discovering conversations (#146927) refactor: reuse plugin fixture shell runner (#146920) fix(worker): stop preparing disabled live previews (#146896) fix(runtime): support Bun across tooling suite (#146807) chore(i18n): refresh native locales (#146924) perf(secrets): limit expiry metadata to transient credentials (#146882) fix(ui): preserve queued refreshes during session discovery (#146535) test(ui): wait for quiet scrolling and close named file tabs (#146836) fix(ui): prevent Usage hour filters from freezing during DST (#146919) test(ui): share browser page cleanup across layout fixtures (#146805) ci: balance complete PR runtime test groups (#146916) improve(infra): reduce scheduling work for session notice bursts (#146818) improve: prepare Gateway skill commands asynchronously (#146812) improve(agents): skip unused assistant delivery parsing (#146858) improve(ui): reuse date formatters across timestamp lists (#146789) fix(tests): isolate installer and Docker shell snippets (#146897) test(heartbeat): share explicit channel configuration fixtures (#146853) fix: retain conversation reply claims through write admission (#146866) perf(sessions): bound history reads and stabilize cursor paging (#146770) ...
* temp/pr-146802: (51 commits) improve: reduce worktree filesystem stalls and archive syncs (#146906) fix(ui): avoid extra chat rail work while replies stream (#146883) improve(ui): speed up populated Usage timelines (#146947) test(gateway): retain auth recovery failure diagnostics (#146925) fix(tests): create private temporary home directories (#146931) fix(backup): preserve discovery under concurrent state writes (#146912) fix: keep queued deliveries in their original state directory (#146917) fix(discord): settle voice waveform work before releasing input (#146885) fix(memory): preserve newer indexes and disclose automatic rebuild costs (#146908) fix: retain route ownership while discovering conversations (#146927) refactor: reuse plugin fixture shell runner (#146920) fix(worker): stop preparing disabled live previews (#146896) fix(runtime): support Bun across tooling suite (#146807) chore(i18n): refresh native locales (#146924) perf(secrets): limit expiry metadata to transient credentials (#146882) fix(ui): preserve queued refreshes during session discovery (#146535) test(ui): wait for quiet scrolling and close named file tabs (#146836) fix(ui): prevent Usage hour filters from freezing during DST (#146919) test(ui): share browser page cleanup across layout fixtures (#146805) ci: balance complete PR runtime test groups (#146916) ...
* fix(runtime): support Bun across tooling suite * fix(security): guard Anthropic probe upstream requests * fix(runtime): preserve native TypeScript script loading
mantis-telegram-failure binds its ingress socket at
os.tmpdir()/oc-vt-XXXXXX/tg-diagnostic-ingress-XXXXXX/api.sock. On macOS that
path is 107 bytes under vitest, past the 104-byte sockaddr_un.sun_path, so
listen() fails with EINVAL. Root the socket dir under realpath("/tmp") on POSIX,
the openclaw#132965 idiom, and keep os.tmpdir() on win32 where the socket is a named
pipe. mantis-telegram-proof gets the same change: its path is 8 bytes under the
limit today.
Rebased onto main 5733bb1. The other half of the original change, spawning
python3 instead of bare python, landed on main in e572c0c (openclaw#146807), so the
conflict resolution takes main's line and this commit is the socket fix only.
Measured on an M4 (macOS, os.tmpdir() under /var/folders), node
scripts/run-vitest.mjs run on both files:
main 5733bb1 5 failed, 22 passed. All five are
mantis-telegram-failure's ingress cases, each
"listen EINVAL" on a 107-byte socket path
main + this commit 27 passed
oxfmt --check and oxlint on both files: clean.
Claude assisted with the rebase and the measurements. The submitter owns the conclusions and final review.
## What Problem This Solves The script tree retains dormant one-off tools and CI inventory rows that its current selector already discards. ## User Impact No user-facing OpenClaw feature or active test selection changes. The maintained `.mts` entrypoints, runtime security checks, and existing CI filter remain in place. ## Why This Change Was Made Delete the 642-line private acceptance probe and 214-line dormant connect installer with their dedicated tests and obsolete test inventory/timing entries. The full reference graph separates package/workflow/docs/skill/config callers from test-only references. The probe has only its dedicated test/timing reference and was last changed September 13 in #146807. The connect wrapper describes itself as dormant and unactivated, has only its dedicated test/Bash inventory references, and was last changed September 27 in #159199. Neither was active this week. Delete 265 literal rows from `ci-proof-test-inventory.mts` that the existing `isOwnerSelectedUiE2eTest` filter already excludes. This is not a change to selection policy: the filter is unchanged and its ordered effective inventory remains 4,098 entries, byte-for-byte identical. The relevant selection policy was established in `cfa5dbf12434053460c60a25ee88fc771c666921` on October 1. Two obsolete five-line `.mjs` aliases are also removed: `check-memory-fd-repro` and `resolve-openclaw-package-candidate`. All current package, workflow, and test callers already use the maintained `.mts` entrypoints; these aliases had no inbound references and no changes since August 9 (#121005). The same reference audit deliberately retained active orphan-looking tools and the iOS sidebar fixture consumed through `OPENCLAW_IOS_ATTENTION_FIXTURE_URL`. No protected PR-tooling closure file changed. Net production reduction: **1,131 lines**, excluding tests and timing data. ## Best-effort tradeoffs accepted None in live behavior. This removes entire uncalled, dormant tools, not their security checks from a maintained path; the CI change removes only rows already filtered out. ## Evidence - Fresh-main reference graph covered 54,316 tracked files, 1,783 scripts and 25,095 edges, including package scripts, workflows/actions, docs, skills, test/runner configs and dynamic resource roots. Independent audit found no live caller or current-week activity for the four deleted tools; all five script targets are outside the 261-file executable PR-tooling closure. - Before/after evaluation of the actual applied commit: all 265 removed rows match the unchanged filter. Ordered effective array SHA-256 stays `048bb0503adb374dbe431844df8c0acc65e0cb42cd44b24c2badea55c3b89ba9`; all three predicates match on 10,279 inputs. Ordered exports and live exempt enumeration also match. - Focused proof: 253 tests passed, including both inventory cases, 140 macOS script cases, 33 maintained memory-FD cases, 61 maintained package-candidate/security cases, lint suppressions and the protected wrapper inventory. Three additional wrapper-extraction cases failed because the existing local install has `mdast-util-from-markdown` 2.0.3 while current main requires 2.1.0. The dependency manifest, lockfile, materializer and failing test are unchanged by this PR. Total wrapper wall time: 443.45 seconds; Vitest reported 397.90 seconds. No timeout, assertion, retry or skip was changed. - Runtime and static cycle checks passed with zero cycles. Independent P0/P1 autoreview was scoped-clean; the applied commit has the identical stable patch ID to that reviewed cut. - Changed-file verification passed all preceding guards, formatting, script types and all four root-test type shards. Script Knip passed with zero entries. The production/full-tree Knip scans both hit their unchanged 600-second deadlines, so the overall command is incomplete at that stage, not green. Its default remote backend did not authenticate or run checks; these are local-fallback results. Full script lint and changed-test lint passed separately. Exact-head hosted CI remains the landing gate. - Hosted CI [run 38204018042](https://github.com/openclaw/openclaw/actions/runs/38204018042) passed at `392e950df000e7dbd095fe9447392d11af7a041c`. Final exact-head census: 177 terminal checks, 79 successful, 97 intentionally skipped, one neutral, no failures or cancellations; dependency/security review and combined CI statuses are successful. No CI reruns or green-only pushes.
…#169606) ## What Problem This Solves The script tree retains dormant one-off tools and CI inventory rows that its current selector already discards. ## User Impact No user-facing OpenClaw feature or active test selection changes. The maintained `.mts` entrypoints, runtime security checks, and existing CI filter remain in place. ## Why This Change Was Made Delete the 642-line private acceptance probe and 214-line dormant connect installer with their dedicated tests and obsolete test inventory/timing entries. The full reference graph separates package/workflow/docs/skill/config callers from test-only references. The probe has only its dedicated test/timing reference and was last changed September 13 in openclaw#146807. The connect wrapper describes itself as dormant and unactivated, has only its dedicated test/Bash inventory references, and was last changed September 27 in openclaw#159199. Neither was active this week. Delete 265 literal rows from `ci-proof-test-inventory.mts` that the existing `isOwnerSelectedUiE2eTest` filter already excludes. This is not a change to selection policy: the filter is unchanged and its ordered effective inventory remains 4,098 entries, byte-for-byte identical. The relevant selection policy was established in `4544bdc0121b1d8fdc917d456015078338775fac` on October 1. Two obsolete five-line `.mjs` aliases are also removed: `check-memory-fd-repro` and `resolve-openclaw-package-candidate`. All current package, workflow, and test callers already use the maintained `.mts` entrypoints; these aliases had no inbound references and no changes since August 9 (openclaw#121005). The same reference audit deliberately retained active orphan-looking tools and the iOS sidebar fixture consumed through `OPENCLAW_IOS_ATTENTION_FIXTURE_URL`. No protected PR-tooling closure file changed. Net production reduction: **1,131 lines**, excluding tests and timing data. ## Best-effort tradeoffs accepted None in live behavior. This removes entire uncalled, dormant tools, not their security checks from a maintained path; the CI change removes only rows already filtered out. ## Evidence - Fresh-main reference graph covered 54,316 tracked files, 1,783 scripts and 25,095 edges, including package scripts, workflows/actions, docs, skills, test/runner configs and dynamic resource roots. Independent audit found no live caller or current-week activity for the four deleted tools; all five script targets are outside the 261-file executable PR-tooling closure. - Before/after evaluation of the actual applied commit: all 265 removed rows match the unchanged filter. Ordered effective array SHA-256 stays `048bb0503adb374dbe431844df8c0acc65e0cb42cd44b24c2badea55c3b89ba9`; all three predicates match on 10,279 inputs. Ordered exports and live exempt enumeration also match. - Focused proof: 253 tests passed, including both inventory cases, 140 macOS script cases, 33 maintained memory-FD cases, 61 maintained package-candidate/security cases, lint suppressions and the protected wrapper inventory. Three additional wrapper-extraction cases failed because the existing local install has `mdast-util-from-markdown` 2.0.3 while current main requires 2.1.0. The dependency manifest, lockfile, materializer and failing test are unchanged by this PR. Total wrapper wall time: 443.45 seconds; Vitest reported 397.90 seconds. No timeout, assertion, retry or skip was changed. - Runtime and static cycle checks passed with zero cycles. Independent P0/P1 autoreview was scoped-clean; the applied commit has the identical stable patch ID to that reviewed cut. - Changed-file verification passed all preceding guards, formatting, script types and all four root-test type shards. Script Knip passed with zero entries. The production/full-tree Knip scans both hit their unchanged 600-second deadlines, so the overall command is incomplete at that stage, not green. Its default remote backend did not authenticate or run checks; these are local-fallback results. Full script lint and changed-test lint passed separately. Exact-head hosted CI remains the landing gate. - Hosted CI [run 38204018042](https://github.com/openclaw/openclaw/actions/runs/38204018042) passed at `392e950df000e7dbd095fe9447392d11af7a041c`. Final exact-head census: 177 terminal checks, 79 successful, 97 intentionally skipped, one neutral, no failures or cancellations; dependency/security review and combined CI statuses are successful. No CI reruns or green-only pushes.
Problem
Running OpenClaw's full tooling suite directly under Bun exposed several runtime mismatches: Node-owned fixture children inherited Bun through
process.execPath, Bun'swscompatibility module obscured the real npm implementation needed by Gateway and worker builds, cross-runtimenode:v8payloads were not portable, and a handful of Bun subprocess,fs.watch, PATH, and exit-code differences made otherwise valid tooling fail or hang.Solution
Route explicitly Node-owned children through the repository's stable Node resolver while keeping the parent test runner on Bun. Use the existing npm
wsimplementation through a focused Gateway adapter, including relocated worker bundles. Make the release-plan child transport runtime-neutral with bounded JSON and canonical base64, harden prompt and process cleanup boundaries, and retain narrowly documented Bun workarounds with removal TODOs.This adds no dependency and does not change how Node installations resolve or run OpenClaw. The adapter uses the existing package graph and only selects the real npm
wsimplementation when Bun shadows the package entrypoint.Validation
1.4.3-canary.1+4d792548b, including partial-pair rejection, live rotation, retained connections, sibling listeners, discovery refresh, and reload-off behavior.pnpm check:changedpassed, including formatting, type-aware lint, all TypeScript lanes, macOS CI suites, database guards, and import-cycle checks.Upstream Bun status
The direct proof uses a patched Bun build because shipping Bun 1.4.2 still lacks the required SQLite fix tracked in oven-sh/bun#40005.
Two additional Bun fixes found by this campaign are open and marked AI-assisted:
https.Server.setSecureContext()support: fix(node:https): support live secure context updates oven-sh/bun#42576