Skip to content

fix: session_recall reads consolidated decisions archive#43

Merged
fazleelahhee merged 1 commit into
mainfrom
fix/copilot-pr42-followup
Apr 27, 2026
Merged

fix: session_recall reads consolidated decisions archive#43
fazleelahhee merged 1 commit into
mainfrom
fix/copilot-pr42-followup

Conversation

@fazleelahhee

Copy link
Copy Markdown
Owner

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_sessions now includes consolidated
    decisions from decisions_log.json. After prune_old_sessions
    archives old session files, those decisions stopped appearing in
    session_recall results — even though cce sessions prune promises
    "Decisions remain searchable via session_recall after pruning".
    get_recent_decisions already does this; _search_sessions did not.

  • Test: test_session_recall_searches_decisions_log_archive
    a sessions dir containing only decisions_log.json (no per-session
    files) must still surface archived decisions via vector recall.

  • Test: tests/storage/test_delete_batching.py — exercises >1500
    file paths through vector / fts / graph stores. df2e991 added the
    batched_params wiring in response to Copilot's IN-clause limit
    finding, but no test asserts the behaviour, so a future regression
    could silently break large-project prunes.

Stats

  • 4 files changed, +121/−1
  • 295 tests pass (291 main + 4 new)

Test plan

  • CI green
  • In a project with >100 sessions, run cce sessions prune, then
    session_recall("<topic in an old decision>") still surfaces it.

🤖 Generated with Claude Code

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>
@fazleelahhee
fazleelahhee merged commit 60a139d into main Apr 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant