Repository navigation
fix(runtime): keep diagnostics and update usable on an unsupported Node - #143344
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 9, 2026, 6:16 PM ET / 22:16 UTC (Revision 11). ClawSweeper reviewWhat this changesThe PR keeps read-only diagnostics available on capable unsupported Node runtimes, preserves private-runtime recovery, and adds consistent runtime findings and upgrade instructions. Merge readiness⛔ Blocked before merge - 1 item remains This remains useful work absent from current main. Both prior code findings are resolved, and the source plus installed-package evidence support clearing the generic migration-proof blocker; no actionable defect remains. Priority: P2 Review scores
Verification
How this fits togetherThe CLI launcher checks Node before loading OpenClaw commands. Its admission decision determines whether to reuse a private runtime, allow read-only diagnostics, or refuse operations that need a supported runtime. flowchart TD
A[CLI invocation] --> B[Node capability check]
B -->|Supported| C[Normal command execution]
B -->|Unsupported| D[Private runtime recovery]
D -->|Compatible runtime found| C
D -->|No compatible runtime| E[Diagnostic command and capability check]
E -->|Allowed| F[Read-only findings and warnings]
E -->|Not allowed| G[Refusal and upgrade guidance]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +200, Tests +655, Docs +40, Other +165. Total +1060 across 30 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Retain one shared diagnostic admission policy, reuse compatible private runtimes first, and preserve supported-runtime requirements at live writer boundaries. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main rejects diagnostic commands on incompatible Node when no compatible private runtime is available. This review did not execute repository code. Is this the best way to solve the issue? Yes. Shared admission, existing private-runtime recovery, and refusal before update state preparation form a coherent repair; no new migration is needed. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7e3a90bf5ce8. LabelsLabel 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)
|
|
Data-model compatibility: this PR makes no schema or persistent-store semantics changes and preserves existing private-copy recovery. The installed-tarball evidence in the PR body recorded eight live-database opens on unsupported Node, all read-only, with unchanged database and WAL hashes. Only SQLite SHM read-lock data changed. |
f0b9514 to
bc00896
Compare
Share CLI admission between the launcher and source guard, retain private-copy SQLite recovery, and keep live database writers and repair agents refused. Route plain Doctor to lint and refuse update before its run-ledger admission when the CLI Node is unsupported. Report CLI/service runtime findings and the reporting Node version in update-failure reports. Refs #140672 #142742
bc00896 to
685b1c0
Compare
|
@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:
|
|
Merged via squash.
|
…de (openclaw#143344) * fix(runtime): keep diagnostics and update usable on an unsupported Node Share CLI admission between the launcher and source guard, retain private-copy SQLite recovery, and keep live database writers and repair agents refused. Route plain Doctor to lint and refuse update before its run-ledger admission when the CLI Node is unsupported. Report CLI/service runtime findings and the reporting Node version in update-failure reports. Refs openclaw#140672 openclaw#142742 * docs(install): explain private Node recovery and diagnostic access * test(runtime): preserve Node recovery coverage with diagnostic admission * fix(runtime): offer Node recovery once per update invocation * fix(build): emit Node 22 syntax for recovery diagnostics * fix(update): check runtime at the state preparation boundary * fix(doctor): preserve migration order before runtime diagnostics * fix(runtime): recover before admitting unsupported Node diagnostics * fix(runtime): preserve capability admission in diagnostic recovery * test(cli): retain capability checks in startup fixtures * refactor(runtime): share Node findings across diagnostic commands * fix(doctor): omit absent repair hints in lint errors
What Problem This Solves
Users updating OpenClaw on an unsupported Node could not run version, diagnostic, or recovery commands. npm can complete installation without running preinstall, leaving users with a package that refuses every command. An unconditional diagnostic exemption also bypassed cached Node recovery on Node 20 and could load a native reader that the runtime cannot execute.
Refs #140672 #142742. Integrates with #143312's canonical SQLite capability admission.
Why This Change Was Made
The packaged launcher and source guard share one explicit command allowlist. When normal admission fails, cached compatible private Node recovery runs before diagnostic admission through the existing re-exec path. Without a compatible cache,
canRunOpenClawNodeDiagnosticsinnode-version.mjsrequires Node >=22 (the bundle syntax target) and the shared SQLite probe's availability result. Incapable runtimes retain the interactive recovery offer or non-interactive refusal before diagnostic code loads.On an unsupported runtime, admitted diagnostics never open a live OpenClaw database writable or start a Gateway/repair agent. Existing private-copy recovery stays intact. Plain Doctor becomes lint-only, triage requires explicit diagnostic mode, and update refuses before live run-ledger admission when its CLI runtime fails admission.
Canonical capability admission also controls lifecycle replay and config reads. Patched builds outside the release table retain main's admission and informational notes; broken builds inside the table remain restricted. Doctor and both status surfaces use one findings collector, including the recorded service runtime, canonical installation guidance, and appropriate severity. Update-failure reports include Node version. Runtime bundles target Node 22 syntax because native
usingdeclarations otherwise prevented these diagnostics from parsing.Node installation and reuse came from @jason-allen-oneal in separately merged #142742. Installer documentation is a separate commit covering Node-only flags, reuse, diagnostic access, and the native Windows proof gap. No user configuration option or schema/store change is introduced.
User Impact
On a capable unsupported runtime,
--version/-V/--help,gateway status, read-only Doctor,update status,update, andtriage --json/--non-interactiveremain available. Admitted diagnostics printRunning on an unsupported Node (<version>); diagnostics may show truncated textonce; findings remain visible. Cached compatible runtimes take precedence. Other commands retain runtime admission requirements.Evidence
Exact-head CI run 34406704095 completed successfully for
aedbf857ecb873adafb14b5b594f27adcb6210d6. The repository watcher returnedGREENwith zero pending checks.The original guard and launcher regressions failed before the repair. The cached-recovery regression ran against launcher owners byte-identical to reviewed head
f0b9514a:Additional failing-before proof covered missing runtime findings/report metadata, missing capability checks, unsafe lifecycle replay on broken in-range Node, skipped lifecycle on admitted patched Node, update admission for patched builds, and missing Doctor repair guidance. Renderer tests failed against the old rendering for false warning labels and undefined repair hints. The repaired suites pass, including 104 launcher/version tests (one optional real-Bun skip), 76 guard tests, the 457-test updater suite, 295 startup tests, and focused Doctor/status tests. The export-collision and import-cycle guards pass. No assertions, baselines, or limits were weakened.
Representative commands:
Final Node 20 recovery proof
Official
node:20resolved to 20.20.2, Linux/arm64. The cache contains the actual Node 26.8.1 executable from the officialnode:26.8.1image; its native SQLite operation was verified in the Node 20 container. Each command uses an isolated synthetic home. The package was installed with scripts disabled to reproduce the npm-on-old-Node shape.openclaw --versionopenclaw: Node 20.20.2: node:sqlite is unavailable; use 24.16+/26.1+ or a build with the fix.If you use nvm, run:
openclaw update statusopenclaw: Node 20.20.2: node:sqlite is unavailable; use 24.16+/26.1+ or a build with the fix.If you use nvm, run:
openclaw gateway statusopenclaw: Node 20.20.2: node:sqlite is unavailable; use 24.16+/26.1+ or a build with the fix.If you use nvm, run:
openclaw --versionOpenClaw 2026.9.3 (aedbf85)openclaw: Node 20.20.2: node:sqlite is unavailable; use 24.16+/26.1+ or a build with the fix.openclaw update statusOpenClaw update status
openclaw: Node 20.20.2: node:sqlite is unavailable; use 24.16+/26.1+ or a build with the fix.openclaw gateway statusService: systemd user (disabled) (diagnostic only, not the probe target)File logs: /tmp/openclaw/openclaw-2026-09-09.log
openclaw: Node 20.20.2: node:sqlite is unavailable; use 24.16+/26.1+ or a build with the fix.Connectivity probe: failed
Artifact head:
aedbf857ecb873adafb14b5b594f27adcb6210d6. Tarball SHA-256:2f9a3feea9e86f8b268609cdedaf37272f3217a3d6b93f597cf0445bf9b0d73b. Package integrity/import checks passed. No native-reader or parser crash occurred. The legacy requirement line remains visible before recovery, as in the existing flow.On the same tarball, official
node:22.23.2with no cached runtime ranopenclaw update status: exit 0, stdout beginsOpenClaw update status, and the required truncated-text warning appeared exactly once. Node's experimental SQLite notice also appeared.Original installed tarball matrix (f0b9514)
Linux/arm64; official
node:22.23.2,node:26.0.0, andnode:26.8.1images. Each installs the same tarball withnpm install --global --ignore-scripts --no-audit --no-fund --prefer-offline, then runs the commands below. Unsupported-runtime cells use copies of a populated synthetic update-ledger database. Output prefixes below are actual first lines; long JSON lines are truncated.Artifact head:
f0b9514ac1cfc550b60fcf982a14a1486ceca1c8. Tarball SHA-256:4161e86181a647265425a5559ebf484ee204cc25a33b3d1fd092e394374d6299.openclaw --versionOpenClaw 2026.9.3 (f0b9514)Running on an unsupported Node (22.23.2); diagnostics may show truncated textopenclaw gateway status --deepService: systemd user (disabled)File logs: /tmp/openclaw/openclaw-2026-09-09.log
Running on an unsupported Node (22.23.2); diagnostics may show truncated textConnectivity probe: failed
openclaw doctor --lint{"ok":false,"checksRun":33,"checksSkipped":30,"findings":[{"checkId":"core/doctor/gateway-auth","severity":"warning","message":"Gateway auth is off or missing a token.","…Running on an unsupported Node (22.23.2); diagnostics may show truncated textopenclaw update statusOpenClaw update status
Running on an unsupported Node (22.23.2); diagnostics may show truncated textopenclaw updateopenclaw: Node.js >=24.16.0 <25, or >=26.1.0 is required (current: v22.23.2).If you use nvm, run:
openclaw triage --json{"promptPath": "/root/.openclaw/logs/support/openclaw-triage-prompt-2026-09-09T20-08-41-148Z-453.md",
Running on an unsupported Node (22.23.2); diagnostics may show truncated textopenclaw gateway startopenclaw: Node.js >=24.16.0 <25, or >=26.1.0 is required (current: v22.23.2).If you use nvm, run:
openclaw --versionOpenClaw 2026.9.3 (f0b9514)Running on an unsupported Node (26.0.0); diagnostics may show truncated textopenclaw gateway status --deepService: systemd user (disabled)File logs: /tmp/openclaw/openclaw-2026-09-09.log
Running on an unsupported Node (26.0.0); diagnostics may show truncated textConnectivity probe: failed
openclaw doctor --lint{"ok":false,"checksRun":33,"checksSkipped":30,"findings":[{"checkId":"core/doctor/gateway-auth","severity":"warning","message":"Gateway auth is off or missing a token.","…Running on an unsupported Node (26.0.0); diagnostics may show truncated textopenclaw update statusOpenClaw update status
Running on an unsupported Node (26.0.0); diagnostics may show truncated textopenclaw updateopenclaw: Node.js >=24.16.0 <25, or >=26.1.0 is required (current: v26.0.0).If you use nvm, run:
openclaw triage --json{"promptPath": "/root/.openclaw/logs/support/openclaw-triage-prompt-2026-09-09T20-08-37-883Z-453.md",
Running on an unsupported Node (26.0.0); diagnostics may show truncated textopenclaw gateway startopenclaw: Node.js >=24.16.0 <25, or >=26.1.0 is required (current: v26.0.0).If you use nvm, run:
openclaw --versionOpenClaw 2026.9.3 (f0b9514)openclaw gateway status --deepService: systemd user (disabled)File logs: /tmp/openclaw/openclaw-2026-09-09.log
Connectivity probe: failedProbe target: ws://127.0.0.1:18789
openclaw doctor --lint{"ok":false,"checksRun":33,"checksSkipped":30,"findings":[{"checkId":"core/doctor/gateway-auth","severity":"warning","message":"Gateway auth is off or missing a token.","…openclaw update statusOpenClaw update status
openclaw updatePhase: requestedPhase: staging
openclaw triage --json{"promptPath": "/root/.openclaw/logs/support/openclaw-triage-prompt-2026-09-09T20-07-36-812Z-114.md",
openclaw gateway startTip: openclaw gateway installTip: openclaw gateway start
Gateway service disabled.The unsupported-runtime warning appeared exactly once in every admitted cell and was absent from refused Gateway starts. Doctor had no check errors on either unsupported runtime and included the Node finding. A separate passive native-SQLite constructor audit recorded eight live-database opens across the diagnostic and update probes, all with
readOnly: true; no writable live opens occurred. Database and WAL hashes remained unchanged. Existing read-only connections updated SHM read-lock data; private-copy recovery was preserved.The bare containers have no config or service manager: Doctor reports configuration warnings,
gateway startreports disabled/unavailable systemd, and supportedupdaterefuses post-plugin verification withpost-plugin-doctor-invalid-config. In a separate valid synthetic configuration on Node 26.8.1, update exited 0 (already-current, plugin verificationok), and a foreground Gateway reached HTTP health readiness and shut down cleanly with exit 0.Known gaps
The full local changed-file check passed typechecks and preceding guards after packaging finished, then encountered the existing ancestor-install declaration boundary at lint (
node_modules/punycode/package.json). The final scoped changed-file check passed, including core/test types and targeted lint; no boundary was disabled. The successful exact-head clean-checkout CI run completed the full lint proof. An earlier concurrent packaging/typecheck attempt saw transient module-format errors while packaging rewrote the root manifest; serialized validation cleared those errors.The final package build reported a Control UI startup gzip-budget warning: 352,248 bytes versus a 352,235-byte limit (13 bytes over). No UI files or budgets were changed.
The native Windows launcher → PowerShell → downloaded-Node handoff remains unproven, as documented. #142742 is already merged separately; this PR does not replace or close it.
Review notes
No persisted state, install records, config schema, database schema, or retention/recovery semantics change. This PR changes runtime admission, read-only diagnostic findings, and their presentation. It does not implement candidate plugin projection or change bundled-alias/external-path installation behavior. The eight audited live database opens were all read-only, with unchanged DB/WAL hashes, as recorded above; private-copy recovery is preserved. No migration or backfill is introduced or required.
The final Doctor rendering repair guards optional hints in both error paths. Its two regression cases are invalid config and snapshot failure with an informational Node capability note and real service repair guidance. On the pre-fix head
aedbf857ecb873adafb14b5b594f27adcb6210d6, both failed on the unwantedundefinedoutput (includingfix: undefined). After the fix, all 48 focused Doctor tests pass:Independent review of this final rendering delta was scoped-clean through P3. The installed-tarball evidence above remains explicitly pinned to its original artifact heads; the final delta only removes absent hint text.
Final rendering-fix head:
c36484bc56de0908198bf599220bf20825b55034. The two-file changed gate andgit diff --checkpass. The fullnode scripts/check-changed.mjspassed all typechecks and preceding guards, then hit the already documented ancestor-install declaration boundary during full lint. Exact-head CI run 34410008620 completed successfully on this final head; the repository watcher returnedGREENwith zero pending checks, including the full clean-checkout lint and Windows test lanes.c36484bc56de0908198bf599220bf20825b55034reports no actionable findings and confirms both prior code findings are resolved.