fix(memory): refresh derived state after memory updates 🤖🤖🤖 - #277
fix(memory): refresh derived state after memory updates 🤖🤖🤖#277Sampoornnagpal wants to merge 2 commits into
Conversation
Signed-off-by: Sampoorn Nagpal <nagpalsampoorn@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthrough
ChangesMemory update behavior
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Memory updates now refresh derived metadata and embeddings when relevant content changes, with no concrete merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Sampoorn Nagpal <nagpalsampoorn@gmail.com>
What does this PR do?
Updating a memory's content leaves its size, token estimate, and sentence count describing the previous text. Updating only tags leaves the embedding describing the previous tags, even though tags are part of
embedding_text().Re-derive content metadata through the Memory schema on content changes and re-embed when the embedding input changes. Preserve record identity and history; unrelated edits and unchanged tags do not call the embedder.
Validation
Five new cases fail before the fix: longer, shorter, and empty content updates, plus tag replacement and removal.
uv run pytest -q packages/nooa-memory/tests/memory/test_memory_manager.py packages/nooa-memory/tests/memory/test_memory_todo.py packages/nooa-memory/tests/memory/test_memory_owner.py packages/nooa-memory/tests/memory/test_memory_schema.py— 67 passed.Windows/Python 3.12, deterministic offline hashing embedder. External import-only helpers bypass #84/#85 (
fcntl/SIGUSR2); they are not part of this PR and do not validate locking or signals.Related issues
No matching open issue found.
Checklist
Summary by CodeRabbit
Bug Fixes
Tests