fix: session_recall reads consolidated decisions archive#43
Merged
Conversation
After prune_old_sessions consolidates per-session JSONs into decisions_log.json and removes the source files, those archived decisions stop appearing in session_recall results — even though the `cce sessions prune` docstring promises "Decisions remain searchable via session_recall after pruning". get_recent_decisions already pulls from the archive; _search_sessions did not. Mirror the pattern: pull rows from `_load_consolidated_decisions()` into the candidate list before vector ranking, so a long-lived project doesn't silently lose context after the first prune. Also add two regression tests that the rest of main was missing: - tests/integration/test_memory_loop.py::test_session_recall_searches_decisions_log_archive proves the fix sticks: a sessions/ dir containing only decisions_log.json (no per-session files) still surfaces the archived decision via _search_sessions. - tests/storage/test_delete_batching.py exercises >1500 file paths through vector / fts / graph stores so the SQLITE_PARAM_BATCH wiring in batched_params can't silently regress (df2e991 added the batching but no test asserts the behaviour). Co-Authored-By: Claude Opus 4.7 (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
Follow-up to #42. After PR #42 merged, one Copilot finding was left
unaddressed and two regression tests didn't make it to main.
Fix:
mcp_server._search_sessionsnow includes consolidateddecisions from
decisions_log.json. Afterprune_old_sessionsarchives old session files, those decisions stopped appearing in
session_recallresults — even thoughcce sessions prunepromises"Decisions remain searchable via session_recall after pruning".
get_recent_decisionsalready does this;_search_sessionsdid not.Test:
test_session_recall_searches_decisions_log_archive—a sessions dir containing only
decisions_log.json(no per-sessionfiles) must still surface archived decisions via vector recall.
Test:
tests/storage/test_delete_batching.py— exercises >1500file paths through vector / fts / graph stores. df2e991 added the
batched_paramswiring in response to Copilot's IN-clause limitfinding, but no test asserts the behaviour, so a future regression
could silently break large-project prunes.
Stats
Test plan
cce sessions prune, thensession_recall("<topic in an old decision>")still surfaces it.🤖 Generated with Claude Code