Repository navigation
feat(daemon): support Bun 1.4 managed services - #129593
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 2:54 AM ET / 06:54 UTC. ClawSweeper reviewWhat this changesAdds Bun 1.4+ as an opt-in runtime for managed Gateway and node-host services, with SQLite safety probing, generated service commands, and repair support. Merge readinessKeep open for maintainer product-direction and merge review: this is a coherent, non-default managed-service capability, not work already present on current main, and no discrete correctness defect was found. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherCLI, onboarding, and wizard flows choose a managed-service runtime, generate platform service commands, and later audit or repair those commands. The resulting service starts Gateway or a node host under the selected runtime. flowchart LR
A[CLI, onboarding, or wizard] --> B[Runtime choice]
B --> C[Bun version and SQLite probe]
C --> D[Managed service plan]
D --> E[Launchd, systemd, or Task Scheduler]
E --> F[Gateway or node host]
F --> G[Audit and repair]
Decision needed
Why: This expands an existing public service-runtime choice and changes repair behavior for installed services; source review cannot determine the desired long-term support commitment. Before merge
Agent review detailsSecurityNone. PR surfaceSource +216, Tests +531, Docs +25, Other +2. Total +774 across 60 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain Node as the default and merge only after maintainers accept Bun as a supervised-service contract and exact-head proof confirms generated Gateway and node-host commands on the supported platform renderers. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds an opt-in capability rather than repairing an established broken behavior; source coverage defines the intended selection and repair paths. Is this the best way to solve the issue? Yes, conditionally: the runtime guard is reused at selection and audit boundaries, and the remaining question is whether maintainers want this supervised-runtime contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fc64c5704a77. 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)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
f3a86c4 to
4bebf1c
Compare
|
Land-ready evidence for exact head
Known proof limits remain explicit: no live macOS launchd or Windows task service-manager run (focused renderer tests cover those plans); custom Node remains the primary, default, and recommended runtime; Bun is an explicit opt-in. Redacted exact-head managed-runtime proof{
"headSha": "4bebf1c59abcd9bb2f8e10782ea5d4fc4749a4fa",
"runtime": {
"name": "bun",
"version": "1.4.0",
"nodeSqlite": true,
"sqliteVersion": "3.53.2",
"supported": true
},
"gatewayPlan": {
"runtimePathAbsolute": true,
"argv": ["<bun>", "<checkout>/dist/index.js", "gateway", "--port", "40029"]
},
"nodeHostPlan": {
"runtimePathAbsolute": true,
"argv": [
"<bun>",
"<checkout>/dist/index.js",
"node",
"run",
"--host",
"127.0.0.1",
"--port",
"40029",
"--no-tls",
"--node-id",
"bun-managed-proof-node",
"--display-name",
"Bun Managed Proof Node"
]
},
"execution": {
"gatewayReady": true,
"gatewayHealthViaNodeControl": true,
"nodeHostPlanAliveAfterStartup": true,
"isolatedState": true
}
} |
|
Merged via squash.
|
* feat(daemon): support Bun 1.4 managed runtimes Amp-Thread-ID: https://ampcode.com/threads/T-01a037b7-66db-71f0-91e7-1578b383afb2 * fix(daemon): enforce Bun SQLite safety Amp-Thread-ID: https://ampcode.com/threads/T-01a037b7-66db-71f0-91e7-1578b383afb2 * fix(daemon): preserve lightweight Bun startup Amp-Thread-ID: https://ampcode.com/threads/T-01a037b7-66db-71f0-91e7-1578b383afb2 * docs: show Bun runtime opt-in commands Amp-Thread-ID: https://ampcode.com/threads/T-01a037b7-66db-71f0-91e7-1578b383afb2 --------- Co-authored-by: Amp <[email protected]>
Related: #129552
What Problem This Solves
OpenClaw can run under Bun 1.4, but managed Gateway and node-host installs still accepted only Node and doctor treated every Bun service as unsupported. Operators therefore could not select Bun for supervised services, and repairs would rewrite an otherwise functional Bun 1.4 service back to Node.
Why This Change Was Made
Add Bun 1.4+ as an explicit managed-runtime option while keeping Node first, default, primary, and recommended. Runtime discovery persists an absolute Bun path only after probing the release floor,
node:sqlite, and its loaded SQLite version against OpenClaw's WAL-reset safety contract; generated packaged and source-checkout commands use Bun directly for Gateway and node-host services.Doctor and start-time repair preserve supported installed Bun paths and migrate unsupported or unsafe Bun services to supported system Node. CLI, onboarding, wizard copy, audits, and docs now share that contract across Linux, macOS, and Windows renderers.
User Impact
Operators can opt into supervised Bun services with
openclaw gateway install --runtime bun,openclaw node install --runtime bun, or onboarding's--daemon-runtime bun. Existing supported Bun 1.4 services remain on Bun during repair. No defaults change: ordinary installs continue to select Node.Release note: managed Gateway and node-host services now support explicit Bun 1.4+ runtimes with WAL-reset-safe
node:sqlite; Node remains the default and recommended runtime.Evidence
1.4.0production probes reportednode:sqlitewith SQLite3.53.2andsupported=true; unsafe SQLite3.51.2is rejected by launcher, selection, and audit regression coverage.bun <checkout>/dist/index.js gateway --port 18942.node_health_ok=true.process.execPath.pnpm check:changedpassed all selected core, core-test, docs, and tooling gates, including production/test type checks, type-aware lint, dead-export scans, docs checks, and architecture guards.pnpm buildpassed; final Codex autoreview and TruffleHog scan were clean.pnpm lint:kysely, assertion-safety, formatting,pnpm tsgo:core, and the fullpnpm build, including the CLI bootstrap import guard. The lightweight in-memory SQLite probe avoids importing persisted-state logger packages during CLI startup.2a73ad9because the build ran before those already-present changes were committed.onboard --install-daemon --daemon-runtime bunandnode install --runtime bun;pnpm docs:check-mdx,pnpm format:docs:check, andgit diff --checkpassed.