feat(agentic): resume_context tool + alias redirect for self-recovery (#714)#731
Merged
Conversation
…#714) On resume, recall excludes the current conversation by design, so the model had no self-callable way to read THIS conversation's own pre-interrupt work. Adds a read-only resume_context tool that renders this conversation's recent turns (via a new RecallSource::this_conversation_recent — the opposite of search's filter), the current <plan> (plan_block), and the saved <state> (now restored by #713); degrades to a clear "no history" line when headless. Advertised always. resolve_tool_alias redirects the instinctive reaches (resume, where_were_we, where_did_we_leave_off, catch_me_up, recap) to resume_context; what_was_i_doing still -> plan_get. recall's no-match text now points at resume_context (keeping the "no matches in past conversations" prefix so #717 telemetry still keys on it). The phantom-reach telemetry (#717) records the new aliases for free. Review fix: the real name resume_context is NOT in the alias list — it returns None so a direct call dispatches as a real tool, not a self-Rewrite that would pollute #717's signal. Fixes #714 Co-authored-by: Claude Opus 4.8 (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.
What this PR does
On resume,
recallexcludes the current conversation by design, so the model had no self-callable way to read THIS conversation's own pre-interrupt work. Adds a read-onlyresume_contexttool that renders this conversation's recent turns (via a newRecallSource::this_conversation_recent— the opposite ofsearch'scurrent_conversation_idfilter), the current<plan>(plan_block), and the saved<state>(restored by #713). Degrades to a clear "no history" line when headless; advertised always.resolve_tool_aliasredirects the instinctive reaches (resume,where_were_we,where_did_we_leave_off,catch_me_up,recap) →resume_context;what_was_i_doingstill →plan_get.recall's no-match text now points atresume_context(keeping the"no matches in past conversations"prefix so #717 telemetry still keys on it). The phantom-reach telemetry records the new aliases for free.Test plan
resume_contextrenders turns+<plan>+<state>from a mock source (+ headless "no history", + turn-load error folded in); the 5 aliases rewrite toresume_contextwhile the real name returnsNone(so a direct call isn't logged as a self-Rewritein #717 telemetry — review fix);recallno-match text containsresume_context; a store-backed integration test provesthis_conversation_recentreturns the current conversation's own last-N turns, fenced.just checkgreen: newt-core lib 442 + store + newt-tui, clippy-D warnings+ fmt clean.Out of scope (follow-ups)
Surfacing the compaction summary (
memory_fetch,Frozenby default), the arg-based recall-query redirect, and the plan-ledger persistence (#713/#718).Fixes #714
🤖 Generated with Claude Code