fix(memory): improve error message when node:sqlite is unavailable#59637
fix(memory): improve error message when node:sqlite is unavailable#59637rrrrrredy wants to merge 6 commits into
Conversation
Greptile SummaryThis PR adds a targeted Confidence Score: 5/5
Reviews (1): Last reviewed commit: "fix(memory): improve error message when ..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 071e227c1c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| "Upgrade to Node.js 22.5+ (with SQLite support) or configure an external embedding provider " + | ||
| "(e.g. OpenAI, Ollama) via memory.provider in openclaw.json. " + |
There was a problem hiding this comment.
Remove impossible remediation from sqlite-missing guidance
When node:sqlite is unavailable, this branch tells users they can recover by configuring an external embedding provider, but that path cannot work in this runtime condition. Both memory backends still require SQLite (openMemoryDatabaseAtPath in manager-sync-ops and QmdMemoryManager.ensureDb) via requireNodeSqlite(), so changing memory.provider does not make memory_search usable. This leaves users with a non-actionable workaround and should be replaced with remediation that restores SQLite availability only.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in ce1e0e1: removed the suggestion to configure an external embedding provider as a workaround for node:sqlite being unavailable. Since both memory backends (openMemoryDatabaseAtPath and QmdMemoryManager.ensureDb) depend on SQLite via requireNodeSqlite(), switching providers cannot restore memory_search functionality. The action text now only surfaces the actionable path: upgrading to Node.js 22.5+.
|
Note on related PR #59488 PR #59488 addresses the same issue but also adds quota error detection ( If maintainers prefer a single PR, I am happy to incorporate the quota detection from #59488 here. Otherwise, #59488 can be rebased after this lands to add just the quota improvement. |
|
CI failures are pre-existing / unrelated to this PR.
Neither failure is caused by the changes here. |
|
This PR is intentionally scoped to fixing the |
|
Addressed the review feedback. I removed the external-provider workaround from the sqlite-missing action text, since both memory backends still require SQLite in this runtime path. The PR is intentionally scoped to the sqlite-missing case only, with a regression test covering the updated action text. |
When memory_search fails because node:sqlite is missing (Node < 22.5 or built without SQLite support), the previous error message was generic: 'Check embedding provider configuration and retry memory_search.' This is misleading — the issue has nothing to do with embedding providers. Now detects the sqlite-missing pattern and returns an actionable message: warning: node:sqlite is not available in this Node.js runtime. Requires Node 22.5+. action: Upgrade Node or configure an external embedding provider via memory.provider. Also adds a docs link so users can find setup instructions. Existing quota and generic error paths are unchanged. Closes openclaw#59451
…ite-missing guidance When node:sqlite is unavailable, all memory backends still require SQLite via requireNodeSqlite() (openMemoryDatabaseAtPath + QmdMemoryManager.ensureDb), so advising users to configure an external embedding provider does not restore memory_search functionality. Remove the 'or configure an external embedding provider' clause and keep only the actionable path: upgrade to Node.js 22.5+ with SQLite support. Also add a test case for the sqlite-missing code path to lock in the corrected action text. Addresses review feedback from chatgpt-codex-connector on PR openclaw#59637.
ce1e0e1 to
fd217f9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd217f95a9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ); | ||
| } | ||
| EOF | ||
| run: node scripts/ci-write-manifest-outputs.mjs --workflow ci |
There was a problem hiding this comment.
Add the manifest writer script before calling it
This step now runs node scripts/ci-write-manifest-outputs.mjs --workflow ci, but that script is not present anywhere in this commit, so preflight fails with ENOENT before it can emit required outputs. That breaks every non-draft ci.yml run and also affects the analogous call added in install-smoke.yml, effectively blocking normal CI routing.
Useful? React with 👍 / 👎.
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| OPENCLAW_PREPACK_PREPARED: "1" |
There was a problem hiding this comment.
Preserve stable release publish tag selection
The publish step no longer passes OPENCLAW_NPM_PUBLISH_TAG, so scripts/openclaw-npm-publish.sh falls back to beta (requestedPublishTag === "latest" ? "latest" : "beta"). With this commit also removing the npm_dist_tag input and promotion job, stable tags dispatched through this workflow will be published to the beta dist-tag with no in-workflow path to mark them latest.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 551c53c7f2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| echo "docs_only=$docs_only" | ||
| echo "run_install_smoke=$run_install_smoke" | ||
| } >> "$GITHUB_OUTPUT" | ||
| run: node scripts/ci-write-manifest-outputs.mjs --workflow install-smoke |
There was a problem hiding this comment.
Restore install-smoke manifest step to a runnable command
The preflight job now executes node scripts/ci-write-manifest-outputs.mjs --workflow install-smoke, but this commit does not add that script anywhere in the tree. That makes the Build install-smoke CI manifest step fail with ENOENT on every non-docs-only run, so the install-smoke workflow cannot reach its smoke checks.
Useful? React with 👍 / 👎.
| @@ -1,276 +0,0 @@ | |||
| name: Plugin ClawHub Release | |||
There was a problem hiding this comment.
Keep the Plugin ClawHub Release workflow
Deleting this workflow removes the only GitHub Actions entrypoint that validates and publishes ClawHub-targeted plugins (publishToClawHub). I checked the remaining .github/workflows content in this commit and there is no replacement workflow invoking the ClawHub release/publish path, so maintainers lose the CI release route for ClawHub packages.
Useful? React with 👍 / 👎.
| - changed-files: | ||
| - any-glob-to-any-file: | ||
| - "extensions/memory-lancedb/**" | ||
| "extensions: memory-wiki": | ||
| - changed-files: | ||
| - any-glob-to-any-file: | ||
| - "extensions/memory-wiki/**" | ||
| "extensions: open-prose": |
There was a problem hiding this comment.
Re-add labeler rules for active extension surfaces
This hunk removes extension label mappings (for example extensions: memory-wiki, and similarly webhooks, arcee, stepfun, plus QA entries in the other hunk) while those extension directories still exist under extensions/. After this change, PRs touching those packages stop receiving their component labels, which breaks maintainers' triage/routing automation for those active surfaces.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7b7e3b645
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @@ -1,70 +0,0 @@ | |||
| name: Docs Sync Publish Repo | |||
There was a problem hiding this comment.
Restore docs publish sync automation
Deleting this workflow removes the only in-repo automation that mirrors docs/** changes into the openclaw/docs publish repository via scripts/docs-sync-publish.mjs; I checked the remaining .github/workflows files and found no replacement job invoking that script or OPENCLAW_DOCS_SYNC_TOKEN. As a result, documentation updates on main will stop propagating to the publish repo, so docs delivery can silently drift.
Useful? React with 👍 / 👎.
| @@ -1,172 +0,0 @@ | |||
| name: Control UI Locale Refresh | |||
There was a problem hiding this comment.
Reinstate control UI locale refresh job
Removing this workflow drops the only scheduled/push-triggered path that runs scripts/control-ui-i18n.ts sync --write and commits regenerated locale bundles; I inspected the current .github/workflows set and none now execute the control UI i18n sync. After this change, updates to ui/src/i18n/locales/en.ts will no longer auto-refresh non-English locale files, leading to stale translated UI strings.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 12460409f0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| - name: Run extension package boundary TypeScript check | ||
| id: extension_package_boundary_tsc | ||
| continue-on-error: true | ||
| run: pnpm run test:extensions:package-boundary |
There was a problem hiding this comment.
Run an existing extension boundary check script
This new step runs pnpm run test:extensions:package-boundary, but package.json at this commit does not define a test:extensions:package-boundary script. Because its outcome is consumed by Fail if any additional check failed, non-doc CI runs with run_check_additional=true will report a failing check-additional job even when all intended checks succeed.
Useful? React with 👍 / 👎.
| pnpm test | ||
| # Linux owns the full repo test suite. Keep the Windows runner focused on | ||
| # Windows-native process/path wrappers so platform regressions fail fast. | ||
| pnpm test:windows:ci |
There was a problem hiding this comment.
Replace undefined platform CI test commands
The Windows test branch now calls pnpm test:windows:ci (and the macOS branch similarly calls pnpm test:macos:ci), but neither script exists in package.json in this commit. These jobs will fail with a missing-command error instead of running tests; run_windows is triggered for most source changes, so this breaks a normal CI lane for routine PRs.
Useful? React with 👍 / 👎.
| @@ -1,42 +0,0 @@ | |||
| name: Docs Trigger Locale Translate On Release | |||
There was a problem hiding this comment.
Restore release locale translation dispatch workflow
Removing this workflow drops the release-time dispatch that sent translate-*-release events to the openclaw/docs repo; after checking the remaining .github/workflows files in this commit, there is no replacement job invoking repos/openclaw/docs/dispatches. As a result, publishing a release no longer triggers locale translation automation for docs.
Useful? React with 👍 / 👎.
CI Status UpdateTwo checks are currently failing on this PR: 1.
|
|
Superseded by #69199. I opened a clean replacement PR that carries only the intended Closing this PR in favor of the replacement to keep review scoped and actionable. |
Summary
node:sqlitewas unavailable (e.g., on older Node.js versions),memory_searchand related tools produced a generic "module not found" error with no actionable guidance.isSqliteMissingdetection branch inbuildMemorySearchToolthat catches the specificnode:sqliteimport failure and returns a structured error with the correct remediation step (openclaw doctor, notopenclaw doctor --memorywhich doesn't exist).buildMemorySearchToolare unaffected. No changes to memory search logic or SQLite usage.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause / Regression History (if applicable)
node:sqlitewas added in Node.js 22.5 (experimental) and requires--experimental-sqlitebefore 23.4; environments without it produce a module-not-found error that wasn't specifically handled.Regression Test Plan (if applicable)
src/node-host/memory-core/isSqliteMissingdetection returns structured error with correct message on sqlite import failure.User-visible / Behavior Changes
Users on unsupported Node versions see a clear "SQLite unavailable" error with
openclaw doctoras the fix, instead of a generic module error.Security Impact (required)
Human Verification (required)
node:sqlite,memory_searchreturns the new structured error with correct remediation step (openclaw doctor).buildMemorySearchToolare unaffected.--experimental-sqliteenabled.Review Conversations
Compatibility / Migration
Problem
When
memory_searchfails becausenode:sqliteis missing, the error message was:This is misleading — the real issue is Node.js version/build, not the embedding provider config. It also breaks AI agent self-diagnosis: agents relying on the error message to understand failures will incorrectly attempt to fix an API key issue instead of a Node runtime issue, wasting multiple turns.
Fix
Detect the
node:sqlitemissing pattern and return a specific, actionable message:{ "warning": "Memory search is unavailable because node:sqlite is not available in this Node.js runtime. The built-in SQLite module requires Node.js 22.5+ compiled with SQLite support.", "action": "Upgrade to Node.js 22.5+ (with SQLite support) or configure an external embedding provider (e.g. OpenAI, Ollama) via memory.provider in openclaw.json. See https://docs.openclaw.ai/memory for setup instructions." }Changes
extensions/memory-core/src/tools.shared.ts: addedisSqliteMissingbranch inbuildMemorySearchUnavailableResultTesting
extensions/memory-core/src/tools.test.ts: thirditblock inside the existingdescribecovers the node:sqlite missing casewarningandactionfields match the new strings exactlyRelated
Closes #59457
node:sqliteis unavailable #59451 (this is step 1 of the long-term fallback mechanism)