fix(ts-sdk): resolve sqlite db paths in OSS mode#4291
Open
mudrii wants to merge 1 commit intomem0ai:mainfrom
Open
fix(ts-sdk): resolve sqlite db paths in OSS mode#4291mudrii wants to merge 1 commit intomem0ai:mainfrom
mudrii wants to merge 1 commit intomem0ai:mainfrom
Conversation
alvinttang
reviewed
Mar 12, 2026
alvinttang
left a comment
There was a problem hiding this comment.
The ensureSQLiteDirectory utility is clean and the :memory: guard is correct. One subtle issue: dbPath.startsWith('file:') skips directory creation for all file-URI paths, including file:/abs/path/to/db.sqlite which is a real on-disk path — if its parent directory doesn't exist the open will fail. Consider only skipping when the path is file::memory: or contains ?mode=memory. Additionally, the top-level historyDbPath propagation in manager.ts only injects into historyStore.config when the provider is SQLite, which is correct, but if userConfig.historyStore is provided with a non-SQLite provider, the top-level historyDbPath is silently dropped — worth at minimum a warning log.
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.
Description
Fixes two OSS SQLite path bugs in the TypeScript SDK:
historyDbPathintohistoryStore.config.historyDbPathwhen the history provider issqlitevectorStore.config.dbPath~/.mem0/vector_store.dbinstead of resolving fromprocess.cwd()Fixes #4290
Type of change
How Has This Been Tested?
Commands run locally:
Additional note:
npm test -- --runInBandfor the entiremem0-tspackage still hits pre-existing failures in unrelated integration-style tests (src/client/tests/memoryClient.test.ts,src/oss/tests/memory.test.ts) that require external services / outdated call signatures. This PR does not modify those areas.Checklist:
Maintainer Checklist