fix(openclaw): add SQLite resilience for OSS mode initialization#4337
Merged
whysosaket merged 2 commits intomainfrom Mar 16, 2026
Merged
fix(openclaw): add SQLite resilience for OSS mode initialization#4337whysosaket merged 2 commits intomainfrom
whysosaket merged 2 commits intomainfrom
Conversation
Fix initPromise poisoning in both PlatformProvider and OSSProvider where a failed init permanently cached the rejected promise, preventing retries. Add disableHistory passthrough so users can opt out of SQLite history storage. Add graceful fallback that auto-retries with history disabled when Memory construction fails (e.g. native binding resolution under jiti). Fixes #4172 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…vider for testability Add 10 tests covering disableHistory config passthrough, initPromise retry after failure, graceful SQLite fallback, and PlatformProvider retry. Export mem0ConfigSchema and createProvider for test access. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
whysosaket
approved these changes
Mar 16, 2026
jamebobob
pushed a commit
to jamebobob/mem0-vigil-recall
that referenced
this pull request
Mar 29, 2026
…0ai#4337) Co-authored-by: utkarsh240799 <utkarsh240799@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
initPromisepoisoning in bothPlatformProviderandOSSProvider— a failed_init()permanently cached the rejected promise, making the provider broken with no retry possible. Now clears the promise on failure so subsequent calls retry.disableHistorypassthrough — exposesoss.disableHistoryin the plugin config so users can explicitly opt out of SQLite history storage (the underlyingmem0ai/ossSDK already supports this viaDummyHistoryManager).new Memory(config)in a try-catch; if construction fails and history wasn't already disabled, automatically retries withdisableHistory: trueand logs a warning. This auto-recovers from native binding failures (jiti resolver regression in OpenClaw 2026.3.x) without losing core memory functionality.Addresses the class of failures reported in openclaw/openclaw#31676, openclaw/openclaw#36377, and #4172.
Configuration
Users hitting SQLite binding issues can now explicitly disable history:
{ "mode": "open-source", "oss": { "disableHistory": true, "vectorStore": { "provider": "qdrant", "config": {} } } }Or rely on the automatic fallback (no config change needed).
Tests
10 new tests added in
openclaw/sqlite-resilience.test.ts(all passing):Config passthrough (4 tests)
disableHistory: truesurvivesresolveEnvVarsDeepconfig parsingdisableHistory: falseis preserved, not coercedundefinedwhen omitted from configosssub-object acceptsdisableHistorywithout unknown-key rejectionOSSProvider passthrough (2 tests)
disableHistory: truereaches theMemoryconstructor when configureddisableHistoryis absent fromMemoryconfig when user doesn't set itinitPromise retry (2 tests)
SQLITE_CANTOPEN),initPromiseis cleared and the next call retries successfully instead of returning the cached rejectionGraceful SQLite fallback (2 tests)
Memory()throws a binding error, automatically retries withdisableHistory: trueand logs aconsole.warn; provider becomes functionaldisableHistoryis alreadytrueand init still fails (e.g. vector store issue), throws immediately — no infinite retry loopTest plan