Skip to content

fix(daemon): distinguish shared and embedded SQLite in system Node warning - #107990

Merged
steipete merged 1 commit into
openclaw:mainfrom
cxbAsDev:fix/runtime-warning-shared-sqlite-wording
Jul 18, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
cxbAsDev:fix/runtime-warning-shared-sqlite-wording

Conversation

@cxbAsDev

@cxbAsDev cxbAsDev commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

#107771 fixed the runtime error message when Node is built with node_shared_sqlite=true. The same misleading wording exists in the daemon-install / doctor gateway-services warning path: when a system Node uses a shared SQLite library that is not WAL-reset-safe, renderSystemNodeWarning still tells the user to "Install Node 24.15+...", which will not upgrade the system library.

Why This Change Was Made

  • NODE_RUNTIME_PROBE now detects process.config.variables.node_shared_sqlite (handling GYP string values) and reports it alongside nodeVersion and sqliteVersion.
  • NodeRuntimeInfo / SystemNodeInfo carry the new nodeSharedSqlite field.
  • renderSystemNodeWarning branches the remediation:
    • Shared system SQLite → "uses shared system SQLite ... Upgrade the system SQLite library ..."
    • Embedded SQLite → existing "Install Node 24.15+ ..." guidance.

This keeps the daemon install warning consistent with the runtime error fix in #107771.

User Impact

Users on distro-packaged Node builds (Kali, Debian, Ubuntu, Homebrew with shared SQLite, etc.) who see the daemon-install or doctor gateway-services warning will now get actionable remediation instead of being told to reinstall Node.

Evidence

  • Head 2be0a026c18 rebased onto upstream/main 29475988dac (2026-07-16); node scripts/run-vitest.mjs src/daemon/runtime-paths.test.ts --run passes 31/31 after the rebase.
  • CI=true pnpm test src/commands/daemon-install-runtime-warning.test.ts src/commands/doctor-gateway-services.test.ts src/commands/daemon-install-helpers.test.ts src/commands/node-daemon-install-helpers.test.ts --run passes (100/100).
  • pnpm exec oxlint --config .oxlintrc.json src/daemon/runtime-paths.ts src/daemon/runtime-paths.test.ts clean.
  • Live before/after proof through the real openclaw daemon install --runtime node workflow on a host whose system libsqlite3 is WAL-reset-unsafe (3.26.0): a real Node 24.15.0 binary probed as the system candidate with its two build-flag-derived facts (node_shared_sqlite, sqlite_version()) simulated via a NODE_OPTIONS preload, because no --shared-sqlite Node ≥ 22.22.3 can run on this glibc 2.28 box (details and raw probe outputs in the proof comment below).
    • Before (upstream/main): System Node 24.15.0 at /usr/local/bin/node uses SQLite 3.26.0, which is not WAL-reset-safe. ... Install Node 24.15+ (recommended) or Node 22.22.3+ from nodejs.org or Homebrew.
    • After (this PR): System Node 24.15.0 at /usr/local/bin/node uses shared system SQLite 3.26.0, which is not WAL-reset-safe. ... Upgrade the system SQLite library to 3.51.3+ (or patched 3.50.7+/3.44.6+), or install a Node build that embeds a safe version.
    • Control (PR build, unmodified real binary): no System Node warning; service installs cleanly.

Fixes no open issue; this is a follow-up to #107771.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Jul 15, 2026
@cxbAsDev
cxbAsDev force-pushed the fix/runtime-warning-shared-sqlite-wording branch 6 times, most recently from 904f8aa to 5f12f1e Compare July 15, 2026 15:18
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 16, 2026
@clawsweeper

clawsweeper Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 16, 2026, 3:53 AM ET / 07:53 UTC.

Summary
The PR extends the system Node probe with shared-SQLite build metadata and gives daemon-install and doctor warnings separate remediation for shared versus embedded SQLite.

PR surface: Source +14, Tests +25. Total +39 across 2 files.

Reproducibility: yes. The submitted current-main daemon-install transcript reaches the misleading warning, and the source path plus the genuine shared-build evidence from the merged sibling fix establish the affected condition with high confidence.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: src/daemon/runtime-paths.test.ts, serialized state: src/daemon/runtime-paths.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • No automated repair is needed; the PR is ready for ordinary maintainer review and check completion.

Security
Cleared: The diff changes only local runtime metadata probing, warning text selection, and tests, with no new dependency, privilege, secret, network, or executable-source surface.

Review details

Best possible solution:

Land the narrow probe and warning update after required checks complete, retaining focused coverage for both shared and embedded SQLite builds.

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

Yes. The submitted current-main daemon-install transcript reaches the misleading warning, and the source path plus the genuine shared-build evidence from the merged sibling fix establish the affected condition with high confidence.

Is this the best way to solve the issue?

Yes. Carrying the build fact through the existing self-contained candidate-Node probe is the narrowest reliable fix and preserves the current embedded-build behavior.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The detailed terminal transcript demonstrates before/after behavior through the real daemon-install workflow and an embedded-build control; the simulated build-only facts are transparent and corroborated by genuine shared-build evidence from the merged sibling change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The detailed terminal transcript demonstrates before/after behavior through the real daemon-install workflow and an embedded-build control; the simulated build-only facts are transparent and corroborated by genuine shared-build evidence from the merged sibling change.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: The patch corrects misleading recovery guidance for a limited set of supported system Node installations without changing runtime selection or stored state.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The detailed terminal transcript demonstrates before/after behavior through the real daemon-install workflow and an embedded-build control; the simulated build-only facts are transparent and corroborated by genuine shared-build evidence from the merged sibling change.
  • proof: sufficient: Contributor real behavior proof is sufficient. The detailed terminal transcript demonstrates before/after behavior through the real daemon-install workflow and an embedded-build control; the simulated build-only facts are transparent and corroborated by genuine shared-build evidence from the merged sibling change.
Evidence reviewed

PR surface:

Source +14, Tests +25. Total +39 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 16 2 +14
Tests 1 27 2 +25
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 43 4 +39

What I checked:

  • Current-main gap: At base SHA fcd2a78, the daemon runtime probe reports Node and SQLite versions but not whether SQLite is shared, so the warning cannot select system-library remediation. (src/daemon/runtime-paths.ts:95, fcd2a784f45f)
  • Focused implementation: The PR probe reads node_shared_sqlite, normalizes boolean and GYP string values, carries the fact through SystemNodeInfo, and branches only the unsafe-SQLite warning guidance. (src/daemon/runtime-paths.ts:95, cf979beeb7aa)
  • Regression coverage: The tests preserve embedded-SQLite Node installation guidance and add the shared-system-library remediation case. (src/daemon/runtime-paths.test.ts:512, cf979beeb7aa)
  • Real workflow proof: The contributor supplied before/after output from the real daemon-install workflow plus an unmodified embedded-build control; the unavailable shared-build facts were injected transparently and the observed output matches the changed branch. (cf979beeb7aa)
  • Sibling-surface provenance: Merged pull request fix(sqlite): distinguish shared system SQLite in WAL safety error #107771 established the same shared-versus-embedded distinction for the runtime WAL-safety error, but did not update this daemon warning path. (src/infra/node-sqlite.ts, 067bc662fa12)
  • Dependency contract: Node documents process.config as the JavaScript representation of build-time config.gypi values, including shared dependency flags represented as strings, supporting the probe's true/"true" normalization.

Likely related people:

  • ekinnee: Authored the merged shared-system-SQLite diagnostic change that established the wording and remediation pattern this daemon follow-up applies. (role: introduced adjacent behavior; confidence: high; commits: 067bc662fa12; files: src/infra/node-sqlite.ts, src/infra/node-sqlite.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (1 earlier review cycle)
  • reviewed 2026-07-16T02:34:13.386Z sha 5f12f1e72dc3c3428011aa847f4746a1c882bb8d :: needs real behavior proof before merge. :: none

@cxbAsDev
cxbAsDev force-pushed the fix/runtime-warning-shared-sqlite-wording branch from 5f12f1e to 2be0a02 Compare July 16, 2026 06:52
@cxbAsDev

Copy link
Copy Markdown
Contributor Author

Re-review proof for the two rank-up items.

Head: 2be0a026c18c158e808dd3fcc70d74f29e27d5f2 — rebased 5f12f1e onto current upstream/main (29475988dac), pushed with --force-with-lease. Diff vs upstream/main is still exactly src/daemon/runtime-paths.ts + its test.

Focused tests (after rebase, Node 24.15.0): node scripts/run-vitest.mjs src/daemon/runtime-paths.test.ts --run → Test Files 1 passed (1), Tests 31 passed (31).

Before/after transcript (real daemon install workflow, unsafe shared system SQLite)

Why approach (b) (simulated build flags) and not a real --shared-sqlite Node: this proof box cannot run one.

  • It is RHEL8-class (glibc 2.28, libsqlite3.so.0 = SQLite 3.26.0). The newest el8-compatible distro Node packages (AlmaLinux 8 AppStream modules, checked live in modules.yaml) are nodejs 22.22.2 / 24.14.1 — both below the supported floor (22.22.3 / 24.15), so they would render the "outside the supported range" branch, not the shared-SQLite branch this PR changes. Newer shared-sqlite distro builds (Fedora/EPEL9/Debian) require glibc ≥ 2.34 and cannot execute here.
  • Every Node ≥ 22.15 build present on the box (24.13.1, 24.15.0, 22.15.1, 25.7.0) is an official embedded-sqlite build: verified node_shared_sqlite=false on all four.

Setup (fully transparent): a real Node 24.15.0 binary was copied (not symlinked, so fs.realpath does not resolve into the nvm tree) to /usr/local/bin/node inside an unprivileged user+mount namespace (unshare --user --map-root-user --mount, no root/sudo, throwaway mounts). A CJS preload (NODE_OPTIONS=--require shim.cjs, inherited by the probe child) simulated only the two build-flag-derived facts no available Node build has: process.config.variables.node_shared_sqlite = "true", and SELECT sqlite_version() → "3.26.0" — which is exactly what a real --shared-sqlite Node would report on this host, since that is the actual version of /lib64/libsqlite3.so.0 here. Everything else is real: real CLI built from the worktree (scripts/run-node.mjs), real probe execution against the real candidate binary, real openclaw daemon install --runtime node --force --port 18789 workflow (systemd unit written), isolated HOME/OPENCLAW_STATE_DIR/OPENCLAW_CONFIG_PATH.

BEFORE (upstream/main 29475988dac build, same scenario) — misleading remediation; the user is already on Node 24.15.0 and reinstalling Node cannot change a shared system library:

System Node 24.15.0 at /usr/local/bin/node uses SQLite 3.26.0, which is not
WAL-reset-safe. Using ~/.config/nvm/versions/node/v24.15.0/bin/node for the
daemon. Install Node 24.15+ (recommended) or Node 22.22.3+ from nodejs.org or
Homebrew.
Installed systemd service: ~/.config/systemd/user/openclaw-gateway.service

AFTER (this PR at 2be0a026c18, same scenario) — shared-specific remediation:

System Node 24.15.0 at /usr/local/bin/node uses shared system SQLite 3.26.0,
which is not WAL-reset-safe. Using ~/.config/nvm/versions/node/v24.15.0/bin/node
for the daemon. Upgrade the system SQLite library to 3.51.3+ (or patched
3.50.7+/3.44.6+), or install a Node build that embeds a safe version.
Installed systemd service: ~/.config/systemd/user/openclaw-gateway.service

Control (PR build, same namespace, shim removed → real embedded-sqlite probe result {"nodeVersion":"24.15.0","sqliteVersion":"3.51.3","nodeSharedSqlite":false}): no System Node warning at all, service installs cleanly. The warning fires only when the probed candidate is genuinely unsafe, and the probe reads the real binary's build flags.

Raw probe outputs against the candidate binary, with and without the shim:

$ node -e <NODE_RUNTIME_PROBE>                        # no shim
{"nodeVersion":"24.15.0","sqliteVersion":"3.51.3","nodeSharedSqlite":false}
$ NODE_OPTIONS=--require shim.cjs node -e <NODE_RUNTIME_PROBE>
{"nodeVersion":"24.15.0","sqliteVersion":"3.26.0","nodeSharedSqlite":true}

Note: the Config health-state write failed: ... uses shared system SQLite 3.26.0 ... lines in the full logs come from the pre-existing config health-state guard (untouched by this PR) reacting to the same simulated unsafe shared library; they appear identically in the before and after runs.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@cxbAsDev
cxbAsDev force-pushed the fix/runtime-warning-shared-sqlite-wording branch from 2be0a02 to cf979be Compare July 16, 2026 07:47
@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head moved to cf979be (rebased onto latest main to pick up ca2d4d7, which fixes the main-broken auto-reply queue state test that failed CI on the previous head; the security-sensitive-guard failure was a CI-side 500 flake). The shared-SQLite proof above remains valid on this head — the PR diff is unchanged (rebase-only).

@clawsweeper

clawsweeper Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 16, 2026
@cxbAsDev

Copy link
Copy Markdown
Contributor Author

This is a follow-up to #107771 — extends the same Node shared-SQLite warning fix to the daemon-install and doctor gateway-services paths.

Why ready to merge:

The change replaces the shared-SQLite probe timeout constant with the same bounded approach used in the already-merged runtime fix. Existing behavior is preserved for embedded SQLite; only the misleading shared-SQLite error message is corrected.

Ready for maintainer review.

@steipete steipete self-assigned this Jul 18, 2026
@steipete
steipete merged commit 94e1cc9 into openclaw:main Jul 18, 2026
210 of 218 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 19, 2026
@cxbAsDev
cxbAsDev deleted the fix/runtime-warning-shared-sqlite-wording branch September 3, 2026 15:32
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

2 participants