hermes-agent/gateway
Teknium 48b5bc6038
fix(gateway): prevent stale memory overwrites by flush agent (#2670)
The gateway memory flush agent reviews old conversation history on session
reset/expiry and writes to memory. It had no awareness of memory changes
made after that conversation ended (by the live agent, cron jobs, or other
sessions), causing silent overwrites of newer entries.

Two fixes:

1. Skip memory flush entirely for cron sessions (session IDs starting with
   'cron_'). Cron sessions are headless with no meaningful user conversation
   to extract memories from.

2. Inject the current live memory state (MEMORY.md + USER.md) directly into
   the flush prompt. The flush agent can now see what's already saved and
   make informed decisions — only adding genuinely new information rather
   than blindly overwriting entries that may have been updated since the
   conversation ended.

Addresses the root cause identified in #2670: the flush agent was making
memory decisions blind to the current state of memory, causing stale
context to overwrite newer entries on gateway restarts and session resets.

Co-authored-by: devorun <devorun@users.noreply.github.com>
Co-authored-by: dlkakbs <dlkakbs@users.noreply.github.com>
2026-03-23 16:08:38 -07:00
..
platforms fix: media delivery fails for file paths containing spaces (#2621) 2026-03-23 06:59:59 -07:00
__init__.py Enhance CLI with multi-platform messaging integration and configuration management 2026-02-02 19:01:51 -08:00
channel_directory.py feat: add SMS (Twilio) platform adapter 2026-03-17 03:14:53 -07:00
config.py fix(config): log warning instead of silently swallowing config.yaml errors (#2683) 2026-03-23 15:54:11 -07:00
delivery.py Merge origin/main into hermes/hermes-5d160594 2026-03-14 19:34:05 -07:00
hooks.py feat(hooks): emit session:end lifecycle event (#1725) 2026-03-17 04:17:44 -07:00
mirror.py fix(cli): respect HERMES_HOME in all remaining hardcoded ~/.hermes paths 2026-03-13 21:32:53 -07:00
pairing.py fix(cli): respect HERMES_HOME in all remaining hardcoded ~/.hermes paths 2026-03-13 21:32:53 -07:00
run.py fix(gateway): prevent stale memory overwrites by flush agent (#2670) 2026-03-23 16:08:38 -07:00
session.py feat(gateway): notify users when session auto-resets (#2519) 2026-03-22 09:33:39 -07:00
status.py fix(gateway): detect stopped processes and release stale locks on --replace 2026-03-21 18:13:53 -07:00
sticker_cache.py fix(cli): respect HERMES_HOME in all remaining hardcoded ~/.hermes paths 2026-03-13 21:32:53 -07:00
stream_consumer.py fix: handle message length overflow in streaming mode (#1783) 2026-03-17 11:00:52 -07:00