fix(memory): make local long-term memory work once models are configured - #66
Merged
Conversation
Four fixes for long-term memory never landing in the desktop local build: - The mem0 singleton captured the model config as of first use; saving the memory/embedding model afterwards only cleared the resolve cache, so writes kept failing 401 against the placeholder key. Model-config routes now also reset the memory runtime, and credential errors trigger a self-healing singleton rebuild (kept out of the Milvus circuit breaker). - The CE audit stub narrowed its signature and raised TypeError on the real implementation's positional call style — after the DB commit, so successful L1 profile writes were reported as failures. The stub now accepts any call. - The Milvus collection was created from the configured dimension (default 1024) while the embedder returns its native width (e.g. 4096). Init now probes the real dimension with one /embeddings call and reconciles an existing collection: an empty one is dropped and rebuilt; a non-empty one (embedding-model switch) is re-embedded with the new model first and only then swapped, so data is never destroyed when the new model is unreachable. - The CE models facade skipped the evolution models and MemoryRefShadow, so their tables never got created locally (23 'no such table' errors per run). Also bump desktop version to 0.2.16 for the next release.
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
Testing
pytest src/backend/tests/memory— 100 passed (includes new CE overlay contract tests).