refactor(agent): derive recall guidance from the tool set, drop the flag - #51
Merged
Conversation
The prompt's "Recall rules" block and the recall tools (recent_entries/ get_entry) were two switches that had to be flipped together: the renderer carried RecallEnabled while the tools were wired off the agent's RecentEntries buffer. They could drift — a prompt advertising a recall ability the tool set doesn't back. Make the tool set the single source of truth: PromptRenderer.Render now derives the recall guidance from whether input.Tools advertises recent_entries (which the harness already populates each turn from the runner's tool registry). The RecallEnabled field and buildBookEngine's recall parameter are gone; wiring the recall tools is what turns the guidance on. No behavior change: TUI wires the recall tools (guidance on), book-run/bench don't (off).
flarexium
force-pushed
the
feat/recall-from-toolset
branch
from
June 15, 2026 04:21
c80ee32 to
04a55b1
Compare
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.
Problem
The cross-turn recall feature had two switches that had to agree:
Recall rulesblock, gated byPromptRenderer.RecallEnabled;recent_entries/get_entry), wired off the agent'sRecentEntriesbuffer.They were flipped together at each call site (
buildBookEngine(..., recall)+ the agent'sRecentbuffer), but nothing enforced agreement — a future change could leave the prompt advertising a recall ability the tool set doesn't back, and the model would call tools that aren't there.Change
Make the tool set the single source of truth.
PromptRenderer.Renderderives the recall guidance from whetherinput.Toolsadvertisesrecent_entries— which the harness already populates every turn from the runner's tool registry (loop.gosetscycleInput.Tools). Wiring the recall tools is now the only thing that turns the guidance on.Removed:
PromptRenderer.RecallEnabledfieldrecall boolparameter onbuildBookEngine(and thetrue/falseat the three call sites)No behavior change
RecentEntriesbuffer) → guidance on.TestPromptRenderer_RecallRulesDerivedFromToolsnow drives the prompt offinput.Toolsinstead of the flag.go build ./...,go vet ./...,go test ./...all pass.🤖 Generated with Claude Code