Repository navigation
feat: use bundled Bun in the Linux companion - #164401
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. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs changes before merge. Reviewed October 3, 2026, 6:14 PM ET / 22:14 UTC (Revision 11). ClawSweeper reviewWhat this changesThe Linux companion bundles verified Bun, uses it for fresh local setup, and offers confirmed runtime switching through the canonical CLI while sharing runtime staging with macOS and CI. Merge readiness⛔ Needs changes before merge - 1 item remains This PR remains useful: current main lacks the Linux companion’s bundled-runtime flow. No blocking introduced code or security findings remain, and direct inspection completes the previous visual gate. The selected native landing route still requires admission of the failed CI attempt. Priority: P2 Review scores
Verification
How this fits togetherThe Linux companion connects desktop users to a local or remote OpenClaw Gateway. For local runtime changes, it passes the confirmed service observation to the CLI, which owns guarded systemd installation and runtime-pin persistence. flowchart TD
A[Verified Bun resources] --> B[Immutable runtime directory]
C[Fresh setup or confirmed runtime choice] --> D[Desktop runtime action]
B --> D
D --> E[Canonical CLI]
E --> F[Service lock and current-state guards]
F --> G[Gateway service and runtime pin]
G --> H[Health result and visible guidance]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +184, Tests +890, Docs +176, Config -9, Other +2104. Total +3345 across 69 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep runtime changes explicit, preserve existing services across desktop updates, and retain the canonical CLI as the sole guarded service writer. Do we have a high-confidence way to reproduce the issue? Not applicable as a feature request. The earlier pause-race concern now has a writer-boundary regression and recorded real native-lock refusal evidence; this read-only review did not execute target code. Is this the best way to solve the issue? Yes. The narrowed Linux adapter reuses the existing service and runtime-pin owners, preserves upgrade behavior, and removes the earlier competing recovery machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 711e57e41b37. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
Linux App CI compiled an empty runtime manifest after #164401, and its relocated onboarding fixture still expected the former installer/Doctor contract. Stage the verified runtime before compilation, preserve its resources in the private fixture, and exercise canonical launcher binding and explicit runtime activation with real bundled Bun. Register the Python-launched CLI fixture with Knip. Production code and native navigation/authority assertions remain unchanged. Validation: exact Linux Gateway switching and onboarding commands, 30 Python tests, 13 Node checks, and 346 Rust tests passed (9 pre-existing ignored). Hosted Linux App and exact-head required CI passed; P2 review and ClawSweeper found no actionable issues.
Embed the shared, verified OpenClaw Bun runtime in the Linux companion without automatically replacing existing Gateway services. Fresh setup and the confirmed Use bundled runtime action delegate to canonical CLI installation with the observed runtime pin and service definition; the writer also preserves an intervening operator pause under its native lock. Remove automatic migration, pending recovery, rollback and Node restoration ownership. Retain immutable runtime directories, document explicit CLI recovery, and keep Tauri on macOS unchanged. Proof: dual Node 24/e167 suites and final 47-case writer/CLI replay; P2 scoped-clean branch review; x64/ARM Cargo, AppImage/deb and ABI smoke; Node-hidden Bun-only smoke; native fresh/adoption/update/pause/reassignment/lock-race and published-CLI compatibility flows. Exact-head CI failures are retained and independently attributed through the native admin exception; see the PR evidence for unresolved main-side test causes.
Linux App CI compiled an empty runtime manifest after openclaw#164401, and its relocated onboarding fixture still expected the former installer/Doctor contract. Stage the verified runtime before compilation, preserve its resources in the private fixture, and exercise canonical launcher binding and explicit runtime activation with real bundled Bun. Register the Python-launched CLI fixture with Knip. Production code and native navigation/authority assertions remain unchanged. Validation: exact Linux Gateway switching and onboarding commands, 30 Python tests, 13 Node checks, and 346 Rust tests passed (9 pre-existing ignored). Hosted Linux App and exact-head required CI passed; P2 review and ClawSweeper found no actionable issues.
What Problem This Solves
The Linux companion needs an embedded, verified Bun runtime without replacing an operator’s Gateway runtime when the app starts or updates.
User Impact
Fresh Linux setup installs the Gateway on bundled OpenClaw Bun. Existing services remain unchanged until the user chooses Use bundled runtime…, sees the current runtime, and confirms. This covers Node, an older bundled Bun, and operator-selected runtimes. A paused service must be started first.
Every runtime installation uses the canonical CLI and the runtime-pin/service-definition observation captured for that action. Changed observations refuse. A failed health check reports the error and the CLI command to return to the previous runtime; there is no automatic rollback. Returning to Node is an explicit terminal action:
openclaw gateway install --force --runtime node.This feature is Linux-only. Tauri on macOS retains its existing behavior; the native macOS app remains its own owner. Windows is deferred until a signed OpenClaw Bun fork build is available; unsigned dry-run artifacts are not shippable. FreeBSD retains system Node.
Why This Change Was Made
The shared pin and stager serve CI, native macOS, and Linux. Linux packaging keeps the verified Bun bytes in the
OPENCLAW-BUN-RUNTIME-V1resource envelope so linuxdeploy cannot rewrite them, then materializes immutable runtime directories. All published runtime directories are retained, including any still referenced by a service or CLI launcher.The launcher marker is informational. Automatic migration, pending recovery, Node backups, restoration menus, retained-Node qualification, and health rollback are removed. Startup, reconnects, and app updates only observe the Linux Gateway. The canonical CLI continues to own installation and service mutation.
The shared e167 pin retains both repin gates: CI paired Node/Bun replay plus the Node-hidden Bun-only smoke, and native macOS probes plus the two-binary gate. Failure of either blocks pin advancement for every consumer. These contracts are documented in the CI pipeline and macOS development setup docs.
Counts include blank/comment lines, exclude tests and docs, and identify embedded Rust test blocks separately. The direct feature-path rewrite against
e76eb74is +867/−1,505 (net −638), excluding unrelated changes brought in by the rebase. The one-line difference comes from the base change.Evidence
Candidate:
bda9182b343f30d8dac8abeb64a59592285c6ddc.9bf(Rust and runtime packaging inputs unchanged by this repair): 346 passed, 9 ignored; AppImage and deb built; packaged smoke passed; 289 ELF files scanned within unchanged ABI floorsscripts/pr merge-runexit 0; exact candidate merged asd9ccc498f15cab42ecd9dca21187c010f163f8b6through the explicitly authorized inherited-failure admin routeMaintainer disposition: the uploaded after capture shows the connected Gateway with Use bundled runtime… disabled, and the paused capture shows the start-first refusal. Both captures were inspected directly; all three images also render correctly in the actual GitHub page. The native owner admitted all nine failed test jobs and the aggregate through the expressly authorized inherited-failure route, retaining the qualified board/worker uncertainties and failed CI result. It verified security, reviews and exact-head identity before submission; completion receipt. The at-landing audit recorded intervening main movement; those 39 changed paths do not overlap this PR’s 69 paths. The landed production delta against the actual parent remains +1,666/−171, net +1,495.
ClawSweeper correctly identified that an operator stop between the app check and the canonical writer lock preserves pin and definition, allowing the install to restart the service. The repair carries the existing-service running requirement to that writer; fresh absence admission remains separate. The regression queues an install behind a canonical stop with unchanged definition/pin and proves no writer or pin update occurs. Other cases cover running stage/install, unknown/failed/disabled state, and fresh absence. The real native-lock stop/install race now passes on the final CLI. An initial fixture-restoration timeout occurred after the seven race assertions passed; a separately instrumented native Start action captured the actual app-descendant CLI and restored a healthy Node service.
Desktop selection changes preserve already-confirmed explicit operations in queue order; they invalidate stale UI publication. Before the CLI starts, the action verifies that its selection is current. Once the confirmed install starts, the canonical CLI owns its service operation and pin/definition guard. This design intentionally has no retained desktop custody, pending recovery, or rollback owner. The real native confirmation reports modal=true. Tray and Connection Settings navigation were observed behind it, and native cancellation preserved all 14 local-service receipt fields. A final background-Connect attempt was refused by the runner readiness check before remote execution; no real target-change interleaving is claimed. Pre-launch selection invalidation remains covered by the Rust regression and source boundary, not a completed live interleaving.
Current-head CI tested merge
5b60b09c7048ecaffc3e868be9aba3e758798213, with maincd9913f1b1105f9c4e7b96fde8c1431a77e5878dand this candidate as ordered parents. The nine failed test jobs cover seven independently reproduced main-owned fixture groups: schema graph allowlist, Copilot Tool Search ordering, voice-call resource count, Google Meet/Codex worker namespaces, compaction producer metadata, and Codex history producer metadata. The latter two were freshly reproduced on that clean main (compaction on Node and e167; history on Node).Two additional failures retain uncertainty: board iframe geometry follows main's percentage-height/flex changes, but persistent CSS failure versus readiness is unresolved; foreground worker shared-state cleanup has an unresolved inner cause, and its earlier-main reproduction is historical because main later changed cleanup. Inspected execution paths and all relevant causal inputs exclude Tauri and guarded service installation; neither is called a fixed flake or a new failing-main reproduction. All 49 named inputs match tested main and merge. Both real-Gateway UI shards and the paired-node status job pass. The aggregate CI gate remains failed. Complete failure logs, checkout identities, source comparisons and scoped passing tests are bound to native admin evidence; no rerun was requested.
Earlier PR-owned failures were fixed: a Linux-excluded readiness helper in a Rust test, missing standalone boundary-test registration in Knip, stale recovery UI text, and a parallel Rust fixture executable-write race. The fixture now uses immutable executable bytes and atomic inode replacement without retries or global serialization.
The three inherited local lint cases are
src/state/openclaw-state-read.worker.ts(701/700),src/gateway/worker-environments/transcript-commit.test.ts(1,042/1,000), andsrc/plugins/doctor-contract-registry.ts(707/700); The state worker and doctor registry plus lint inputs still match the newly tested main. The transcript test changed in #164103, so its recorded failure is explicitly old-base-only until new evidence qualifies it. The failed local full check is retained as failed, with no baseline change.The initial full focused suites are retained; the two affected test files passed again on Node 24/e167 on both Darwin and Linux after the pause repair. Runtime proofs use private 0700 HOME, state and temporary directories. Native x64 Rust/UI/package inputs are byte-identical between the package head and this candidate; the final CLI package is built from this candidate, and all 9,552 installed JavaScript files match it.
The live fixture proves actual native menus, GTK confirmation/refusal dialogs, systemd writers and a signed synthetic A→B app update. The simulated older bundle is a distinct immutable directory containing the same verified e167 bytes; startup/quit preserve all 14 receipt fields and the referenced directory, then explicit adoption selects the current slot. Runtime reassignment while confirmation is open causes a stale-observation refusal with all 14 fields unchanged. Independently installed CLI launchers and legacy marker absence survive adoption. Published 2026.9.5 compatibility is a separate real registry installation (8,079 JavaScript files verified against its integrity-checked tarball), without a candidate CLI upgrade.
ARM smoke first exposed a host/package library mismatch on Ubuntu 26, then a missing FUSE helper in the Ubuntu 22 container. Installing the OS FUSE package and replaying the unchanged packaged scanner on the native ARM baseline passed. The final CLI build initially hit the existing process-group guard; the same build passed with Docker's init enabled, without source or guard changes.
Native runtime selection
The Node Gateway offers the explicit action. After confirmation, the Gateway runs on bundled Bun and the action is disabled. These are actual native captures from the synthetic Linux fixture.
An operator-paused Gateway refuses the action and preserves its service binding:
Measured focused test costs
Initial feature qualification on macOS Node 24, measured as individual command wall time with one worker through the repository wrapper, before the eight pause cases were added. These are not hosted CI seconds. No persistent worker pin or serial test configuration is introduced.
src/cli/command-startup-policy.test.tssrc/cli/daemon-cli/install.test.tssrc/cli/daemon-cli/register-service-commands.test.tssrc/cli/daemon-cli/status.projection.test.tssrc/cli/daemon-cli/status.runtime-intent.test.tssrc/daemon/runtime-pin-service.test.tssrc/daemon/runtime-pin-state.test.tssrc/scripts/ci-changed-scope.test.tstest/scripts/ci-linux-git.test.tstest/scripts/ci-platform-checkout.test.tstest/scripts/stage-openclaw-bun.test.tsThe final pause-repair replay runs 17 native service cases plus 30 CLI cases. Vitest per-file durations on the isolated proof host are 187.92s / 35.70s on Node 24 and 83.46s / 36.07s on e167 Bun; total command wall times are 242.561s / 146.223s. The first Node run includes a cold worker build; Bun reuses those outputs. These are separate measurements from the initial table.