fix(gateway): add missing session_key param to _async_flush_memories - #5379
fix(gateway): add missing session_key param to _async_flush_memories#5379Mibayy wants to merge 1 commit into
Conversation
Function was defined with only old_session_id but all 3 call sites pass a second session_key argument, causing TypeError at runtime. Memory is never flushed on session reset, expiry, or resume. Fixes: NousResearch#5358-related Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CI status noteThe failing tests in this PR are pre-existing failures on
None of the failing tests touch the code changed in this PR ( |
|
Thanks for the careful analysis, @Mibayy! This is a well-described and correct fix — unfortunately the code it patches was completely removed from Commit
The background memory review loop (firing every 10 user turns) is now the sole memory-persistence path, making the session-boundary flush unnecessary. Because the method and all its callers are gone, the Closing as already superseded on main. This is an automated hermes-sweeper review. |
Summary
_async_flush_memorieswas defined with onlyselfandold_session_idas parameterssession_key/key), causing aTypeError: _async_flush_memories() takes 2 positional arguments but 3 were givenat runtimeFix
Added
session_key: str = ""as a second parameter to the function signature. The parameter is accepted but not used inside the function body — it is passed by callers for contextual logging at the call site and does not need to be forwarded into_flush_memories_for_session.One-line diff:
Impact
Without this fix, any path that triggers memory flushing silently crashes (the
TypeErroris caught by surroundingtry/exceptblocks), so accumulated memories are discarded on every session boundary instead of being persisted.Test plan
TypeErroris raised when sessions expire, reset, or resume"Pre-reset memory flush completed")🤖 Generated with Claude Code