Repository navigation
fix(desktop): Bun Gateways need an installed Node for computer control - #159462
Conversation
A Bun Gateway could not control its managed desktop without a separate Node.js install: the computer host resolved a real Node from the desktop PATH (#147275, then #151933 skipped Bun's node shim). Under Node that owner already returned process.execPath; under Bun it demanded a second runtime even though the helper and the CUA provider run on Bun. Spawn the helper with process.execPath and resolveRuntimeWorkerArgv, the contract other runtime workers use. Node keeps the same executable. The runtime test now asserts the helper runs on the host's executable; it fails under Bun with the previous code, which launched a PATH node. The Linux live proof gains --runtime to start the built Gateway on another executable with no node on PATH and to record every owned process's executable. Docs drop the Node requirement and note that Bun 1.4.2 lets launched desktop apps inherit the helper's streams until Bun marks inherited descriptors close-on-exec like Node (openclaw/bun#12).
|
🦞👀 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 27, 2026, 1:55 AM ET / 05:55 UTC. ClawSweeper reviewWhat this changesThe branch runs the Gateway’s private computer-control helper on the Gateway’s own runtime, extends the Linux live-proof script to select a runtime, strengthens its runtime assertion, and updates Bun desktop documentation. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 5 items remain Keep this PR open. The fix is still needed on current main, and the supplied live evidence supports Bun-only desktop control. The unconditional runtime switch also changes working Bun-plus-Node installations to a Bun build that can stall execution cleanup and terminate a launched app. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway computer service starts a private helper for its managed desktop. That helper loads the configured computer plugin, sends actions to the desktop driver, and returns observations to the requesting Gateway client. flowchart LR
A[Computer request] --> B[Gateway computer service]
C[Managed desktop environment] --> B
B --> D[Helper runtime selection]
D --> E[Private computer helper]
E --> F[CUA desktop driver]
F --> G[Desktop actions and observations]
Decision needed
Why: The branch fixes Bun-only control but changes cleanup behavior for an already working installation; accepting that upgrade cost or preserving the fallback requires an explicit compatibility choice. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource -4, Tests +2, Docs +3, Other +49. Total +50 across 5 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the working Node helper for Bun installations that have Node until a supported Bun build contains the descriptor fix; allow Node-free Bun installations through the new path with its cleanup limitation clearly documented and verified. Do we have a high-confidence way to reproduce the issue? Yes. Current main’s Node resolver rejects a Bun Gateway without installed Node, and the PR supplies a real Linux Gateway/desktop scenario; this read-only review did not rerun it. Is this the best way to solve the issue? No. Using the Gateway’s executable solves Bun-only startup, but the unconditional switch changes cleanup on existing Bun-plus-Node installations before the Bun descriptor fix ships. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 92b337d61552. 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
|
|
Maintainer response to the ClawSweeper review of
|
|
Merged via squash.
|
…penclaw#159462) A Bun Gateway could not control its managed desktop without a separate Node.js install: the computer host resolved a real Node from the desktop PATH (openclaw#147275, then openclaw#151933 skipped Bun's node shim). Under Node that owner already returned process.execPath; under Bun it demanded a second runtime even though the helper and the CUA provider run on Bun. Spawn the helper with process.execPath and resolveRuntimeWorkerArgv, the contract other runtime workers use. Node keeps the same executable. The runtime test now asserts the helper runs on the host's executable; it fails under Bun with the previous code, which launched a PATH node. The Linux live proof gains --runtime to start the built Gateway on another executable with no node on PATH and to record every owned process's executable. Docs drop the Node requirement and note that Bun 1.4.2 lets launched desktop apps inherit the helper's streams until Bun marks inherited descriptors close-on-exec like Node (openclaw/bun#12).
…penclaw#160226) * fix(browser): keep Chrome MCP from probing npm on Bun-only installs The pinned chrome-devtools-mcp server runs an update check that shells out to `npm config get registry`. On a Bun-only install there is no npm, so the Bun-only runtime smoke records an unlisted Node attempt in its browser step. Launch the server with CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS=1, which its check-for-updates helper honors before spawning anything. Drop three expected-node-blockers entries that no longer reproduce on main: chrome-mcp-user-profile (fixed by openclaw#159422), tool-search-code-probe (source removed with tool_search_code in openclaw#159398), and computer-control (the host runs on the Gateway's runtime since openclaw#159462; never exercised on headless Linux). * fix(browser): leave custom Chrome MCP servers' update checks alone Only the packaged, pinned chrome-devtools-mcp server gets the update-check opt-out. Custom mcpCommand servers are operator-managed and keep their upstream update notices; the transport now forwards the environment the option normalizer chose.
…penclaw#160226) * fix(browser): keep Chrome MCP from probing npm on Bun-only installs The pinned chrome-devtools-mcp server runs an update check that shells out to `npm config get registry`. On a Bun-only install there is no npm, so the Bun-only runtime smoke records an unlisted Node attempt in its browser step. Launch the server with CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS=1, which its check-for-updates helper honors before spawning anything. Drop three expected-node-blockers entries that no longer reproduce on main: chrome-mcp-user-profile (fixed by openclaw#159422), tool-search-code-probe (source removed with tool_search_code in openclaw#159398), and computer-control (the host runs on the Gateway's runtime since openclaw#159462; never exercised on headless Linux). * fix(browser): leave custom Chrome MCP servers' update checks alone Only the packaged, pinned chrome-devtools-mcp server gets the update-check opt-out. Custom mcpCommand servers are operator-managed and keep their upstream update notices; the transport now forwards the environment the option normalizer chose.
What Problem This Solves
Fixes: a Bun Gateway cannot control its own managed desktop unless a separate Node.js is installed, which blocks the Bun-only macOS and Tauri desktop installs.
User Impact
Gateway computer control now runs its private helper on the Gateway's own runtime. A Bun Gateway controls its managed desktop with no
nodeon the host and zero paired nodes. Node Gateways keep exactly the executable they used before.Behavior change, accepted by the owner: a Bun Gateway that also has Node installed now runs the helper on Bun too, instead of finding that Node. On Bun builds without openclaw/bun#12 (upstream Bun 1.4.2 and the current CI pin), closing a computer execution that launched a desktop app takes the Gateway's 30-second cleanup path. The app is stopped on close either way, as it already was under Node. The fix ships in the fork release
openclaw-v1.4.3-20260927-a70be26b47-webkit-35e8970dfd, which the desktop apps pin.Why This Change Was Made
The Node requirement was incidental, not a Bun incompatibility. #147275 resolved
nodefrom the desktopPATH, and #151933 moved that lookup toresolveNodeRuntimeExecutableto skip Bun'snodeshim. Under Node that owner already returnsprocess.execPath; under Bun it went looking for a second runtime. The helper now spawnsprocess.execPathwithresolveRuntimeWorkerArgv, the contract most runtime workers already use.The provider stack runs on Bun. On Linux and Windows the CUA provider loads the
@trycua/cua-driverNode-API addon, which imports onlynapi_*symbols that the fork implements (no libuv ornode::symbols). On macOS it speaks MCP over stdio to the app-ownedcua-driverbinary and never loads the addon.Live proof surfaced one runtime difference that belongs in the fork, not here. Node marks inherited descriptors close-on-exec at startup (
uv_disable_stdio_inheritancein Node'ssrc/node.cc); the fork did not on POSIX. An app the CUA driver launched therefore inherited the helper's stdio protocol channel. The helper exited cleanly, but the Gateway waited for EOF until its 30 second cancel timer stopped the orphaned app. The fix is openclaw/bun#12, now merged. Until a Bun build includes it, computer control still works; closing an execution that launched an app just takes the 30 second cleanup path, which the Bun compatibility page now documents.The Linux live proof gains
--runtime <executable>: it starts the built Gateway on that executable, refuses aPATHcontainingnode, records each owned process's executable from/proc/<pid>/exe, and fails if the Gateway, its helper, or any owned process ran elsewhere or on Node.Evidence
Linux live proof on Blacksmith Testbox (
tbx_01m3gkbkem3hy9c8wny4e7vyhp, hydration run), driver and Gateway both on Bun,nodeabsent fromPATH,/usr/local/bin/nodemoved aside, zero paired nodes (node.listempty). Each run covered screenshot,list_appsdiscovery and launch of Mousepad, click, typing a unique marker, accessibility readback of that marker, helper join on execution close, replacement generation, stale-generation rejection, and joined Gateway shutdown (exit 0, all owned processes gone). Every owned process ran on the selected Bun executable or a desktop binary; none ran Node.fdinfoflags1.4.3-canary.1+ddfce5d0100 / 01 / 01main9e3414b3, built on the box00 / 01 / 0102000000 / 02000001 / 0200000102000000 / 02000001 / 02000001A same-box
stracecomparison showed the Gateway itself (not the helper) sending the orphaned MousepadSIGTERM: 12 ms after helper exit on Node, 30 s after it on Bun./procconfirmed Mousepad's fds 0-2 were the helper's stdio sockets under Bun and closed under Node.Managed desktop, then Mousepad before and after typing through the shared CUA provider, all from the Bun Gateway with the fork fix:
Tests and checks:
pnpm test src/gateway/desktop/computer-process.runtime.test.ts src/gateway/desktop/computer-process.test.ts src/gateway/desktop/computer-authority.runtime.test.ts src/gateway/desktop/computer-service.test.ts→ 35 passed.OPENCLAW_VITEST_RUNTIME=bun pnpm test src/gateway/desktop/computer-process.runtime.test.tsfails on the previous code (runtime:/opt/homebrew/Cellar/node/26.9.0/bin/nodeinstead of the Bun executable) and passes with this change;computer-authority.runtime.test.tsalso passes on Bun.pnpm test src/gateway/desktop/computer-process.runtime.test.ts --maxWorkers=1took 25-43 s wall including the wrapper, with cases at 2.7-4.1 s on Node, unchanged from before.pnpm tsgo:core,pnpm tsgo:scripts, oxlint and oxfmt on changed files, markdownlint,docs:check-mdx,docs:check-links, andgit diff --checkpass. Codex autoreview is clean at P2 after one accepted finding (the proof no longer strips wholePATHdirectories).macOS app worker (
dist/mac-node-worker.js): its computer-use path needs no Node on Bun. On darwin the provider uses the MCP stdio client to the app-ownedcua-driver, spawned through the supervisor relay onprocess.execPath, and never loads the addon. It never starts the Gateway computer host. The one real-Node dependency in that worker is adjacent: the Browser plugin's managed Chrome MCP server still usesresolveNodeRuntimeExecutable.Follow-ups, not in this PR: CI's pinned fork build predates openclaw/bun#12, and bumping it needs a new fork release; the Chrome MCP launch above needs the same runtime treatment.