feat(recall): expose session resume as the recall_resume MCP tool - #1010
Merged
Conversation
The `synapt resume` CLI answers "where did we leave off" by position (the last N turns of a session) rather than by relevance, pairs the tail with the journal that session wrote, and labels index freshness. Until now it was reachable only from a shell, so an agent starting from inside an MCP runtime had the journal but not the tail, and the two diverge whenever work continued after the journal was written. recall_resume wraps the same build_resume_view / format_resume path the CLI uses, on the bounded resume index (never the full index), and closes the DB it opens. Freshness is attached after the view is built and can only change what the reader is told, never what is shown; a freshness failure renders as NOT CHECKED rather than as fresh. The empty-index and unresolved-session outcomes stay distinguishable, as in the CLI. Registered with the directive check alongside recall_sessions. Tests cover the missing-index, honest-empty, unresolved-session, argument pass-through, freshness-failure, and registration paths. Co-Authored-By: Claude <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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Exposes the existing
synapt resumesurface as an MCP tool,recall_resume.synapt resumeanswers "where did we leave off" by position (the last N turns of a session), pairs that tail with the journal entry the session wrote, and labels the index-freshness verdict. It was CLI-only, so an agent starting inside an MCP runtime could read the journal but not the tail. The two diverge whenever work continued after the journal was written, and the journal then presents stale next steps as current.What changed
recall_resume(session_id=None, turns=10)inserver.py, wrapping the samebuild_resume_view/format_resumepath the CLI uses.load_resume_index), never the full index, and closes the DB it opens.recall_sessions; listed in the Codex skill's tool inventory.Verification
tests/recall/test_server_resume.py: missing index, honest empty, unresolved session, argument pass-through with freshness failure, and registration. 5 tests.test_server_resume.py,test_server_sessions.py, and the resume module tests: 91 passed.server.pycarries the same five pre-existing findings asorigin/dev(four E402 import placement, one F541 f-string without placeholders), measured withruff check --statisticson both, none introduced here.synapt resume.Premium boundary: recall is OSS (session-tail retrieval over the local transcript index; no identity or org semantics).