fix: Prevent memory overwrite by flush agent (add-only constraint)#2676
Closed
dlkakbs wants to merge 1 commit into
Closed
fix: Prevent memory overwrite by flush agent (add-only constraint)#2676dlkakbs wants to merge 1 commit into
dlkakbs wants to merge 1 commit into
Conversation
…raint) Flush agent reviewed stale conversation history and called replace/remove on memory entries that may have been updated by the live agent, other sessions, or cron jobs since the conversation ended. Restrict flush agent to add-only action so existing entries are never overwritten with stale context.
b528445 to
861c9e6
Compare
Contributor
|
Merged via #2687. Your identification of the overwrite mechanism was spot-on. The salvage PR took a different approach — instead of restricting the flush agent to add-only, we inject the current memory state directly into the flush prompt so it can make informed decisions with full tool access. Both contributors credited. Thanks! |
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.
Fixes #2670
Summary
replace/removeon memory entries based on stale conversation history, silently overwriting changes made by the live agent, other sessions, or cron jobs after the session endedadd-only action so existing entries are never modified with stale contextTest plan
~/.hermes/memories/MEMORY.mdType of Change
Changes Made
gateway/run.py: Addedadd-only constraint to the flush agent prompt in_flush_memories_for_session(), preventingreplace/removeactions on memory entries that may have been updated since the conversation endedHow to Test
~/.hermes/memories/MEMORY.mdsystemctl --user restart hermes-gateway)MEMORY.md- entries written by the live agent should be preserved, not reverted