Skip to content

fix(update): update split-root Bun Gateway installs with their pinned runtime - #160495

Merged
steipete merged 6 commits into
mainfrom
steipete/bun-split-root-service-route
Sep 28, 2026
Merged

steipete merged 6 commits into
mainfrom
steipete/bun-split-root-service-route

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Related: #159431

What Problem This Solves

Fixes openclaw update refusing an owned Bun Gateway at a different package root with original-service-unverified, and Bun package commands selecting bare bun from PATH instead of the verified executable.

User Impact

Owned split-root Bun Gateway installations update in place with their recorded runtime pin; the invoking CLI installation stays unchanged. Package probes and installation retain the selected Bun even when PATH has no Bun or contains a different build.

Update behavior: the installed updater runs first. In the live Linux fixture, published 2026.9.6 with no Bun on PATH refused early with ENOENT, leaving the Gateway and both roots unchanged. With the fork Bun on PATH, that same published driver updated service root B in place and restarted healthy while CLI root A stayed unchanged. This PR's routing and verified-executable selection apply from the first candidate containing them; a newer candidate cannot retroactively change its installed driver's first hop.

Why This Change Was Made

Reuse the existing service-root update route and the shared Bun/SQLite executable validation, while preserving Node service routing and destination ownership checks. Bun's emulated Node version is not checked against engines.node. A Node-based updater still passes the target's Node engine and SQLite preflight because finalization retains the updater runtime. Bun package commands use the verified service Bun, then the current Bun process executable, with PATH only as the final fallback.

The two commits were rebased onto the prerequisite squash merge without conflicts. Initial production LOC: +10 net; the Doctor follow-up below adds +6 net. The three installation/update docs describe runtime selection and first-hop behavior; the changelog remains release-owned.

Evidence

The original reviewed commits record five expected pre-fix failures for service routing/executable selection, plus two pre-fix failures for the old-Node and missing-SQLite-TEXT updater cases; those regressions passed after the fixes. Rebased-head validation and per-file single-worker wall times are recorded below.

Validated head: c4421ba82d6c6e36c3ff2005aac0f59ffdd2a0f0.

node scripts/run-vitest.mjs <file> --maxWorkers=1: 5 Test Files / 92 tests passed, measured separately with /usr/bin/time -p (133.45 s total wall).

Test file Tests passed Wall time
src/cli/update-cli/update-command-service-plan.test.ts 47 50.70 s
src/cli/update-cli/update-command-service-root-plan.test.ts 7 12.49 s
src/cli/update-cli/update-command-target.n1-prefix.test.ts 7 14.67 s
src/infra/update-global.bun-owner.test.ts 6 19.65 s
src/cli/daemon-cli/install.reinstall.test.ts 25 35.94 s

Wall times include harness compilation, module transforms, and cleanup. These existing suites exercise runtime admission, update destination selection, package activation/cleanup, and daemon reinstall pin retention through their owning boundaries. CI timing is pending.

Also passed: pnpm tsgo:core (14.29 s wall), scoped oxlint and oxfmt on all 15 changed TypeScript files, oxfmt and MDX validation on all three changed docs, and git diff --check. Independent Codex autoreview against origin/main completed with no actionable P0–P2 findings.

Live proof ran on AWS Crabbox lease cbx_761305c7e96a, using the verified fork Bun build 6b9148b1 (1.4.3-canary.1+6b9148b17) and candidates built on the box. A is the invoking CLI installation; B is the managed Gateway installation. Initial S1/S2/S3 used c4421ba82d6c6e36c3ff2005aac0f59ffdd2a0f0; fresh S0′/S1b/S2b used the candidate built from 332b0938b61a7541a026d2c2996989a372006690.

Upgrade-compatibility proof (published driver × candidate)

The live cells below are the upgrade-compatibility proof requested by ClawSweeper: S0 uses published 2026.9.6 without Bun on PATH and refuses early with the Gateway and both roots unchanged; S0′ uses published 2026.9.6 with the fork Bun on PATH and updates B in place to a healthy candidate; S1/S2 exercise candidate Node/Bun drivers; S1b/S2b after 332b0938 verify maintenance leaves the updated Gateway running. This PR changes no schema, config format, or persisted data model. Runtime pins and service definitions keep their existing formats; no data migration is required.

Live cell Observed result
S0: published 2026.9.6, no Bun on PATH Early ENOENT refusal; Gateway PID and both package roots unchanged. This did not reach the topology guard.
S0′: published 2026.9.6, fork Bun on PATH Update exited 0 (162.605 s); B advanced in place and restarted healthy on the fork; A stayed 2026.9.6.
S1: candidate Node CLI / S2: candidate Bun CLI B advanced; A stayed unchanged; fork runtime pin retained. Observed Bun package writers used the absolute fork executable.
S3: stock Bun first on PATH Update succeeded; the package writer still used the absolute pinned fork executable.
S1b / S2b before the Doctor fix After aligning A with B, repair stopped the Gateway and left it stopped. A separate manual reinstall restored health; that is historical failure evidence, not successful repair proof.
S1b / S2b after 332b0938 Update/align/repair/Doctor exits were 0/0/1/0. Through alignment, repair and Doctor, post-update PIDs 149594/145986 and fork pins stayed unchanged; all 76/51 liveness samples were active with HTTP 200, and final health passed. Repair exited 1 with actionable installation-drift guidance before any stop.

Native lifecycle timestamps, restart counts and maintenance journals also showed no stop/restart during the fixed maintenance cells; approximately one-second samples do not claim continuous observation. No manual restart, reinstall or guard override was used for those reruns. The Linux fixture exercises the protected service-root path and explicit Bun writer, but does not independently isolate the owned-Bun routing predicate. System Node remained 24.18.1. Fixtures used synthetic credentials only; no credentials or raw private logs are included here. No configuration, stored schema or service-definition format changes are introduced; upgrade compatibility is covered by the published-driver and candidate-driver cells above.

Live-proof follow-up: S1b/S2b Doctor admission

On c4421ba82d6c6e36c3ff2005aac0f59ffdd2a0f0, S1b (Node updater) and S2b (Bun updater) aligned the original invoking CLI A with the updated service installation B, then ran repair and Doctor from A. Repair returned exit 0/status warning but stopped the Bun Gateway at B and left it stopped because cross-installation reconciliation could not be verified. The separate manual reinstall from B restored health; it does not count as successful repair proof.

The fix excludes Bun runtimes at resolveGatewayServiceInstallationRefreshRoot, the shared admission owner for moving a service onto another CLI root. Doctor performs this inspection before the native stop. Explicit repair from A now refuses maintenance with installation-drift guidance while leaving the service and state untouched; run repair from B instead. Diagnostic service repair retains its drift note and skips installation. Node cross-root refresh admission is unchanged. No configuration, stored schema, or service-definition format changed.

Follow-up head: 332b0938b61a7541a026d2c2996989a372006690.

Three regression cases failed before this fix: the real Doctor health flow admitted cross-root Bun maintenance with and without update context, and direct Doctor service repair invoked the installer. The corrected focused proof passed 4 Test Files / 56 tests, all with --maxWorkers=1:

Selection Passed Wall time
src/flows/doctor-health.test.ts — Bun regressions and existing foreign-running controls 4 tests; 70 unrelated cases skipped 44.13 s
src/commands/doctor-maintenance.installation.test.ts — full suite, including Node cross-root behavior 32 tests 109.60 s
src/daemon/service-layout.test.ts and src/cli/update-cli/update-command-service-root-plan.test.ts 20 tests across 2 files 37.29 s together

The broader Doctor health migration matrix was interrupted to focus on these contracts; no full-file pass is claimed for that file. Wall times include harness preparation and cleanup. Core tsgo, Doctor and general source test-type graphs, scoped oxlint/oxfmt, both changed docs' MDX checks, git diff --check, and independent autoreview passed with no actionable P0–P2 findings. CI timing for this head is pending; no CI run was dispatched or rerun for proof.

Follow-up LOC versus c4421ba: production +8/−2 (net +6); tests +73/−1 (net +72); docs +14/−0. Fresh live S1b/S2b replay against this exact fix is complete, as recorded in the table above. Both Gateways remained healthy with unchanged PID and pin through maintenance. The requested all-zero maintenance outcome was not observed: repair intentionally returned 1 with drift guidance, leaving the service running. The original failed cells remain recorded separately.

Documentation follow-through: head 6745aaeb2eb9d20a6910f273aa6f5f87e27ebe95 corrects the same published-driver statement in docs/install/bun-compatibility.md and docs/install/updating.md. This is a docs-only delta from the live-tested 332b0938 production code. Both files passed oxfmt and MDX validation; git diff --check and independent Codex autoreview passed with no actionable P0–P2 findings. Current-head CI and ClawSweeper review remain landing gates.

Refresh validation: merged main f010fc0b579071d151e8f4e4084a40ac0b219057 without conflicts into head dbf35a674cffdbf8e6ce9b390df5d19b1f369f78. The updater node-runtime/noop and service-plan/service-root-plan selections passed 4 Test Files / 65 tests, using node scripts/run-vitest.mjs <files> --maxWorkers=1, in 137.66 s wall. Independent Codex autoreview found no actionable P0–P2 findings; git diff --check and the export-name collision guard passed. Package manifests and lockfile are unchanged versus main. Exact-head CI and ClawSweeper remain required landing gates.

Assertion follow-up: b5f3bace55c231b5f6b2466151699150c77e8d35 updates the three planner output assertions to runtime-neutral wording, including the negative control. This fixes the stale expectation in CI run 36455674328 / job 109044885440. No production behavior changes in this follow-up.

Focused validation with node scripts/run-vitest.mjs <files> --maxWorkers=1: 4 Test Files / 79 tests passed, 77.13 s total wall. The complete src/cli/update-cli.node-runtime.test.ts passed 18 tests (48.01 s Vitest duration); the service-plan, service-root-plan, and target.n1-prefix files passed 47, 7, and 7 tests respectively (19.34 s combined Vitest duration). Total wall includes wrapper preparation and cleanup. Scoped oxfmt/oxlint, git diff --check, and independent Codex autoreview passed with no actionable P0–P2 findings. Repository search found no remaining old quotes of these planner messages; the separate Node-only schema diagnostic remains unchanged. Exact-head CI and ClawSweeper re-review are pending.

Hosted assertion-fix proof: on exact head b5f3bace55c231b5f6b2466151699150c77e8d35, CI run 36458778939, the formerly failing checks-node-changed-compact-large-7 job 109052394328 passed. Its Node test step took 545 s (17:34:09–17:43:14 UTC); total job time was 587 s. These are mixed-shard timings, not isolated-file timings. Aggregate CI and the fresh ClawSweeper verdict are still pending.

…ir own Bun

Route owned split-root Bun Gateway services through the existing service-root
update path, leaving the invoking CLI installation unchanged. Validate the
service executable with the shared Bun and WAL-safe node:sqlite owner instead
of comparing Bun's emulated Node version with engines.node. Keep Node rebind
behavior, destination ownership, and the existing runtime-pin restart contract.

Use the verified service Bun for Bun-owned package probes and installation;
otherwise select the current Bun process executable before falling back to PATH.
Consolidate repeated plan returns and keep their data types with service context.

Update behavior: the installed updater runs first. Published 2026.9.6 still
attempts cross-root rebinding and refuses a Bun split-root service before
stopping it (original-service-unverified); the Gateway keeps running. This
change applies from the first updater candidate that contains it.

Validation: five expected pre-fix failures; focused Vitest 8 files / 166 tests
passed in 95.27s with --maxWorkers=1. After planning cleanup, 4 files / 66 tests
passed in 101.29s; final runtime checks passed 2 files / 52 tests in 69.00s.
Core tsgo, the full source-test lane, final affected test types, scoped oxlint,
oxfmt, three-file MDX sanity, and diff whitespace checks passed. The optional
changed-graph selector encountered an unrelated UI inventory budget of 721/720;
the full source-test lane ran successfully. Boundary proof covers pin retention
and failed-stage cleanup; no operator Gateway was modified.
…ects

Finalization retains the updater runtime even when an owned Bun service selects
its own package root and runtime. Validate a Node updater through the existing
Node engine/capability preflight before allowing the Bun service update, retain
its refusal details, and preserve the service Bun pin when both runtimes pass.
Service recovery cannot replace the runtime retained by finalization.

Extend the target-boundary regression for old Node, missing SQLite text
capability, and supported Node; both refusal cases failed before the fix.
Clarify the additional updater requirement in the Bun/update documentation.
The installed updater must contain this fix; it cannot be supplied retroactively
by the candidate package.

Validation: 3 focused Test Files / 61 tests passed with --maxWorkers=1 in 56.28s.
Core tsgo, CLI update test types, scoped lint/format, three-page MDX validation,
diff whitespace checks, and independent autoreview passed.
@clawsweeper

clawsweeper Bot commented Sep 28, 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 docs Improvements or additions to documentation cli CLI command changes size: L labels Sep 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 1:53 PM ET / 17:53 UTC (Revision 6).

ClawSweeper review

What this changes

The branch makes updates target an owned Bun Gateway’s installation with its verified runtime, prevents cross-root Doctor repair from stopping that Gateway, and updates regression tests and installation guidance.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open. Current main does not handle the reported split-root Bun case. The prior upgrade-compatibility question is answered by the recorded published-driver and candidate-driver runs, and this review found no actionable patch defect.

Priority: P2
Reviewed head: b5f3bace55c231b5f6b2466151699150c77e8d35

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Detailed before-and-after live upgrade evidence and focused boundary regressions support a small production repair without an identified defect.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The recorded Linux split-root runs exercise the changed update and Doctor production paths: published and candidate drivers show safe first-hop behavior, an in-place Gateway update with its pinned Bun, and post-fix repair refusal before shutdown. Those production files are unchanged at the reviewed head. No stored-data contract changes, so data-model migration proof is not applicable.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The recorded Linux split-root runs exercise the changed update and Doctor production paths: published and candidate drivers show safe first-hop behavior, an in-place Gateway update with its pinned Bun, and post-fix repair refusal before shutdown. Those production files are unchanged at the reviewed head. No stored-data contract changes, so data-model migration proof is not applicable.
Evidence reviewed 9 items Current main still lacks Bun split-root routing: The fetched main revision selects only a Node service runner and may rebind a writable split-root Bun service to the invoking installation.
Introduced service-root selection: The pinned PR delta validates the service Bun and selects the Gateway package root when that owned Bun service runs from another installation.
Runtime and package-writer selection: The updater validates Bun independently of Node engines; the package target receives the selected service executable, while a Bun-driven fallback uses its current process executable.
Findings None None.
Security None None.

How this fits together

The update CLI reads the invoking installation and the managed Gateway’s service definition before choosing a package root and runtime. That choice controls package installation, service restart, and later Doctor maintenance.

flowchart LR
 A[Invoking CLI] --> C[Owned service inspection]
 B[Gateway definition and runtime pin] --> C
 C --> D{Bun at another root?}
 D -->|Yes| E[Gateway package root]
 D -->|No| F[Existing update route]
 E --> G[Verified Bun install]
 G --> H[Service restart]
 F --> H
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +16, Tests +319, Docs +73. Total +408 across 23 files.

View PR surface stats
Area Files Added Removed Net
Source 12 113 97 +16
Tests 8 420 101 +319
Docs 3 81 8 +73
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 23 614 206 +408

Review metrics

Metric Value Why it matters
Production and test delta production +16 net, tests +319 net The production growth is tied to runtime selection and pre-stop admission; the larger regression coverage exercises those boundaries.
Stored-format changes 0 schemas, 0 migrations The update uses existing service definitions and runtime pins, so the prior compatibility question concerns behavior across versions rather than a data migration.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/cli/update-cli/update-command-target.ts, migration/backfill/repair: src/commands/doctor-maintenance-inspection.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep update destination and runtime selection with the existing service and package owners, preserving the Bun pin and refusing cross-root repair before service shutdown.

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

Yes. Current-main routing and the contributor’s before-fix Linux fixture identify the refusal path, while the Doctor follow-up records the earlier service-stop failure; this read-only review did not execute them.

Is this the best way to solve the issue?

Yes. The patch uses the existing service-root route and pinned-runtime validator, and places the Doctor refusal before service shutdown.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3e4e9cd4aeee.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a limited but real managed-Gateway update failure for split-root Bun installations.
  • merge-risk: 🚨 availability: Update and Doctor paths can stop a managed Gateway; the recorded live maintenance runs directly tested that availability-sensitive boundary.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The recorded Linux split-root runs exercise the changed update and Doctor production paths: published and candidate drivers show safe first-hop behavior, an in-place Gateway update with its pinned Bun, and post-fix repair refusal before shutdown. Those production files are unchanged at the reviewed head. No stored-data contract changes, so data-model migration proof is not applicable.
  • proof: sufficient: Contributor real behavior proof is sufficient. The recorded Linux split-root runs exercise the changed update and Doctor production paths: published and candidate drivers show safe first-hop behavior, an in-place Gateway update with its pinned Bun, and post-fix repair refusal before shutdown. Those production files are unchanged at the reviewed head. No stored-data contract changes, so data-model migration proof is not applicable.

Evidence

What I checked:

  • Current main still lacks Bun split-root routing: The fetched main revision selects only a Node service runner and may rebind a writable split-root Bun service to the invoking installation. (src/cli/update-cli/update-command-service-plan.ts:662, 3e4e9cd4aeee)
  • Introduced service-root selection: The pinned PR delta validates the service Bun and selects the Gateway package root when that owned Bun service runs from another installation. (src/cli/update-cli/update-command-service-plan.ts:661, b5f3bace55c2)
  • Runtime and package-writer selection: The updater validates Bun independently of Node engines; the package target receives the selected service executable, while a Bun-driven fallback uses its current process executable. (src/cli/update-cli/update-command-target.ts:421, b5f3bace55c2)
  • Doctor guard: The introduced guard excludes Bun from cross-root service installation refresh before Doctor maintenance can stop the service. (src/daemon/service-layout.ts:49, b5f3bace55c2)
  • Authority revalidation: Existing update maintenance rereads the effective service and checks its admitted definition and current authority immediately before stopping it. (src/cli/update-cli/update-command-service-maintenance.ts:521, b5f3bace55c2)
  • Real upgrade and recovery observations: The captured PR body reports published 2026.9.6 refusing safely without Bun on PATH and updating the Gateway root when Bun is available. Candidate Node/Bun drivers retained the pin; after the Doctor fix, repair refused before stop and the Gateway remained healthy. The contributor clarified that no persisted format changes.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • darkamenosa: 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 (5 earlier review cycles)
  • reviewed 2026-09-28T14:32:36.758Z sha c4421ba :: blocked before merge. :: none
  • reviewed 2026-09-28T15:49:09.787Z sha 332b093 :: blocked before merge. :: none
  • reviewed 2026-09-28T16:20:14.657Z sha 6745aae :: blocked before merge. :: none
  • reviewed 2026-09-28T17:12:38.521Z sha dbf35a6 :: blocked before merge. :: none
  • reviewed 2026-09-28T17:41:13.064Z sha b5f3bac :: blocked before merge. :: none

Live S1b/S2b proof found that repair from an aligned CLI installation stopped
the Bun Gateway at another root, then left it stopped after reconciliation failed.
Reject Bun at the shared cross-root refresh admission owner before Doctor can
stop the service. Keep the existing refusal and drift details, directing repair
to the Gateway installation rather than advising a manual stop. Node refresh
admission is unchanged.

Regression proof exercises the real Doctor health/maintenance flow, including
update context, and direct Doctor service repair. Three new cases failed before
the fix. Focused tests: 4 Test Files / 56 tests passed with --maxWorkers=1.
Doctor flow selection: 44.13s wall; installation suite: 109.60s; service layout
and routing suites: 37.29s together. Core/test types, scoped lint/format, MDX,
diff whitespace, and independent autoreview passed. The broader health migration
matrix was interrupted to focus the proof; live S1b/S2b replay remains pending.
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Sep 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime commands Command implementations labels Sep 28, 2026
@steipete
steipete marked this pull request as ready for review September 28, 2026 16:09
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please re-review head 332b0938b61a7541a026d2c2996989a372006690. The PR body now records completed exact-head S1b/S2b live evidence (unchanged Gateway PID/pin and healthy throughout alignment, repair and Doctor; repair exits 1 with drift guidance before stop), the historical defect, and the observed published 2026.9.6 controls. No stored-data format changes are introduced.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 28, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Landing paused at head 6745aaeb2eb9d20a6910f273aa6f5f87e27ebe95: CI run 36449342316, attempt 1, failed check-source-contracts (job 109021164765) and openclaw/ci-gate (job 109023482095). The source check reports nine duplicate exported names in src/cli/daemon-cli.ts: assertForegroundUpdateOrigin, isManagedUpdateRequesterOwner, runDaemonInstall, runDaemonRestart, runDaemonStart, runDaemonStatus, runDaemonStop, runDaemonUninstall, and waitForGatewayUpdateRecovery.

The exact check, node --import ./scripts/tsx.mjs scripts/check-export-name-collisions.mts, also fails with the same nine names on clean main 504687668a7fcc94ace1c2dc85e7aec3d26ae103; main commit 5de949fc4620b4c62d05d780caa11870dad506ac added the duplicate wrapper declarations. This PR does not modify those declarations or the checker. This is a deterministic inherited lint failure, so no flaky-test rerun was used. The run finished with 50 successful, 108 cancelled, 20 skipped and 2 failed jobs; cancelled coverage is not a pass. No merge or auto-merge request was submitted.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review new head dbf35a674cffdbf8e6ce9b390df5d19b1f369f78, refreshed from main with the current CI fixes. The PR body explicitly labels S0/S0′, S1/S2, and fixed S1b/S2b as the published-driver × candidate upgrade-compatibility proof. This PR changes no schema, config format, or persisted data model; runtime pins and service definitions keep their existing formats. Focused refresh validation passed 4 Test Files / 65 tests (137.66 s wall, single worker), and independent autoreview found no actionable P0–P2 findings.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor Author

On the remaining "data-model compatibility proof" item: this PR changes no schema, config format, or persisted data. Runtime pins, service definitions, and the update/rollback ledgers keep their existing formats, so there is nothing to migrate. The upgrade-compatibility proof is the live published-driver × candidate matrix in the PR body (AWS Crabbox, pinned fork Bun):

  • published 2026.9.6 driver: refuses safely when no Bun is on PATH (Gateway and both roots unchanged), and updates the Gateway's own root in place with the fork Bun on PATH
  • candidate drivers (Node CLI and Bun CLI) update the owned split-root Bun Gateway in place, keep its runtime pin, and use the pinned Bun as the package writer
  • after aligning the CLI, repair and Doctor leave the Gateway running (Doctor fix 332b093)

That is the upgrade path in both directions this change can affect.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

New head: b5f3bac. Updated all three stale planner assertions to runtime-neutral wording, including the negative control. The full node-runtime suite plus service-plan, service-root-plan, and target.n1-prefix suites passed: 4 Test Files / 79 tests, 77.13 s wall with node scripts/run-vitest.mjs <files> --maxWorkers=1. Scoped oxfmt/oxlint, git diff --check, and independent Codex autoreview passed with no actionable P0–P2 findings. Repository search found no other stale references to these planner messages; the separate Node-only schema message remains unchanged.

The existing data-model item is answered in comment 5875045715: no schema, config, persisted-data, or service-definition format changes. Published-driver × candidate and post-fix Doctor live evidence remain in the PR body.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 6a55147 into main Sep 28, 2026
247 checks passed
@steipete
steipete deleted the steipete/bun-split-root-service-route branch September 28, 2026 17:55
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
… runtime (openclaw#160495)

* fix(update): update split-root Bun Gateway installs in place with their own Bun

Route owned split-root Bun Gateway services through the existing service-root
update path, leaving the invoking CLI installation unchanged. Validate the
service executable with the shared Bun and WAL-safe node:sqlite owner instead
of comparing Bun's emulated Node version with engines.node. Keep Node rebind
behavior, destination ownership, and the existing runtime-pin restart contract.

Use the verified service Bun for Bun-owned package probes and installation;
otherwise select the current Bun process executable before falling back to PATH.
Consolidate repeated plan returns and keep their data types with service context.

Update behavior: the installed updater runs first. Published 2026.9.6 still
attempts cross-root rebinding and refuses a Bun split-root service before
stopping it (original-service-unverified); the Gateway keeps running. This
change applies from the first updater candidate that contains it.

Validation: five expected pre-fix failures; focused Vitest 8 files / 166 tests
passed in 95.27s with --maxWorkers=1. After planning cleanup, 4 files / 66 tests
passed in 101.29s; final runtime checks passed 2 files / 52 tests in 69.00s.
Core tsgo, the full source-test lane, final affected test types, scoped oxlint,
oxfmt, three-file MDX sanity, and diff whitespace checks passed. The optional
changed-graph selector encountered an unrelated UI inventory budget of 721/720;
the full source-test lane ran successfully. Boundary proof covers pin retention
and failed-stage cleanup; no operator Gateway was modified.

* fix(update): keep the updater runtime preflight for Bun service redirects

Finalization retains the updater runtime even when an owned Bun service selects
its own package root and runtime. Validate a Node updater through the existing
Node engine/capability preflight before allowing the Bun service update, retain
its refusal details, and preserve the service Bun pin when both runtimes pass.
Service recovery cannot replace the runtime retained by finalization.

Extend the target-boundary regression for old Node, missing SQLite text
capability, and supported Node; both refusal cases failed before the fix.
Clarify the additional updater requirement in the Bun/update documentation.
The installed updater must contain this fix; it cannot be supplied retroactively
by the candidate package.

Validation: 3 focused Test Files / 61 tests passed with --maxWorkers=1 in 56.28s.
Core tsgo, CLI update test types, scoped lint/format, three-page MDX validation,
diff whitespace checks, and independent autoreview passed.

* fix(doctor): leave split-root Bun Gateways at their own install root

Live S1b/S2b proof found that repair from an aligned CLI installation stopped
the Bun Gateway at another root, then left it stopped after reconciliation failed.
Reject Bun at the shared cross-root refresh admission owner before Doctor can
stop the service. Keep the existing refusal and drift details, directing repair
to the Gateway installation rather than advising a manual stop. Node refresh
admission is unchanged.

Regression proof exercises the real Doctor health/maintenance flow, including
update context, and direct Doctor service repair. Three new cases failed before
the fix. Focused tests: 4 Test Files / 56 tests passed with --maxWorkers=1.
Doctor flow selection: 44.13s wall; installation suite: 109.60s; service layout
and routing suites: 37.29s together. Core/test types, scoped lint/format, MDX,
diff whitespace, and independent autoreview passed. The broader health migration
matrix was interrupted to focus the proof; live S1b/S2b replay remains pending.

* docs(update): clarify published split-root Bun behavior

* test(update): assert the runtime-neutral planner messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: L 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