fix(agent-context): wire inject_semantic_recall into production path and fix recall accumulation#4040
Merged
Merged
Conversation
9180334 to
94b4765
Compare
…and fix recall accumulation ContextService::inject_semantic_recall was never called from the agent turn loop — tiered retrieval was silently inactive for all production sessions. Wire the production path in assembly.rs through the new inject_semantic_recall_bare method so tiered retrieval now activates when configured. remove_by_part_or_prefix only removed Role::System recall messages, leaving Role::User messages inserted by the tiered-retrieval path to accumulate across turns. Extend the retain predicate to also remove Role::User messages whose content starts with RECALL_PREFIX. Closes #4022 Closes #4019
94b4765 to
1a92a5e
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.
Summary
ContextService::inject_semantic_recallinto the agent turn loop via the newinject_semantic_recall_baremethod inzeph-agent-context; the production assembly path inzeph-corenow delegates to it, activating tiered retrieval for all production sessions.remove_by_part_or_prefixto removeRole::Usermessages withRECALL_PREFIX(in addition toRole::System), preventing recall messages from accumulating across turns when tiered retrieval is enabled.Test plan
service::tests::remove_recall_messages_removes_user_role_recall— verifiesRole::Userrecall messages are cleaned upservice::tests::inject_semantic_recall_tests::inject_semantic_recall_bare_no_memory_returns_ok— verifies the new production APICloses #4022
Closes #4019