fix(gateway): init memory store for flush agent - #6179
Closed
r266-tech wants to merge 1 commit into
Closed
Conversation
The pre-reset memory flush created a temporary AIAgent with skip_memory=True, preventing _memory_store initialization. The memory tool was in enabled_toolsets so the model could call it, but every call returned "Memory is not available." — making the flush completely non-functional for all messaging platform sessions. Change skip_memory to False so the MemoryStore is properly initialised. The flush prompt already includes memory state read from disk, so any system-prompt injection from the memory provider is redundant but harmless. Closes NousResearch#6157
Contributor
|
Thanks for the careful investigation and fix, @r266-tech! The root cause you identified was real at the time. This is an automated hermes-sweeper review. Unfortunately this PR is now obsolete:
The underlying concern (memory extraction on session reset) is now handled by the background memory review loop, which runs every 10 turns on both CLI and gateway without the blocking/cache-invalidating flush approach. Closing as superseded. |
1 task
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
Fixes #6157 — the gateway pre-reset memory flush created a temporary
AIAgentwithskip_memory=True, which prevented_memory_storefrom being initialised. Since the memory tool was still inenabled_toolsets, the model could call it but every call returned"Memory is not available."— making the flush path completely non-functional for all messaging platform sessions (Telegram, Discord, Matrix, etc.).Changes
skip_memory=True→skip_memory=False(1 line)skip_memory=Falsein the flush agent constructorRoot cause
When
skip_memory=True,run_agent.py:977-992skipsMemoryStore(...)creation, leaving_memory_store = None. The memory tool atmemory_tool.py:452then returns an error on every call.Test plan
pytest tests/gateway/test_flush_memory_store.py)