JimStenstrom
cb5c24e37d
fix(agent): sync logging session context on compaction id rotation
...
When context compaction rotates agent.session_id, it updates the gateway/tools
session context (set_current_session_id -> HERMES_SESSION_ID env + ContextVar)
but never updates the separate logging session context. The [session_id] tag on
log lines comes from hermes_logging._session_context (set once per turn in
conversation_loop.py), so post-compaction log lines in the same turn carry the
STALE old id while the message/DB/gateway state carry the new one — breaking log
correlation exactly at the compaction boundary.
Call hermes_logging.set_session_context(agent.session_id) alongside the existing
set_current_session_id, guarded so a logging failure can't regress the routing
update. Logs-only; no runtime or caching impact.
Refs #34089
2026-06-07 22:30:02 -07:00
..
2026-05-30 02:08:36 -07:00
2026-06-06 18:33:44 -07:00
2026-06-05 03:53:59 -07:00
2026-05-28 00:20:11 -07:00
2026-06-06 13:18:18 +05:30
2026-06-07 02:02:40 -07:00
2026-06-07 22:22:01 -07:00
2026-05-31 06:14:34 -07:00
2026-05-15 14:00:01 -07:00
2026-06-07 22:18:31 -07:00
2026-05-18 10:14:38 -07:00
2026-06-07 22:06:48 -07:00
2026-05-29 04:22:27 -07:00
2026-05-17 04:04:15 -07:00
2026-05-29 04:22:27 -07:00
2026-06-07 06:14:24 -07:00
2026-05-28 22:26:09 -07:00
2026-05-28 22:26:25 -07:00
2026-06-07 22:09:45 -07:00
2026-05-29 19:05:03 -07:00
2026-06-07 22:30:02 -07:00
2026-06-07 22:20:43 -07:00
2026-05-19 00:12:41 -07:00
2026-05-25 00:32:08 -07:00
2026-06-07 22:05:14 -07:00
2026-05-26 15:41:11 -07:00
2026-06-06 13:18:18 +05:30
2026-06-01 02:07:32 -07:00
2026-06-07 22:23:29 -07:00
2026-05-28 04:52:42 -07:00
2026-06-04 06:16:45 -07:00
2026-06-02 14:03:37 +10:00
2026-05-14 08:03:56 -07:00
2026-06-05 03:53:59 -07:00
2026-04-28 06:46:45 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 01:23:06 -07:00
2026-06-03 12:00:27 -07:00
2026-05-24 18:10:47 -07:00
2026-05-13 22:31:28 -07:00
2026-06-07 21:50:57 -07:00
2026-06-07 18:33:20 -07:00
2026-05-16 17:59:32 -07:00
2026-05-28 00:20:11 -07:00
2026-04-28 12:27:36 -07:00
2026-04-30 23:03:54 -07:00
2026-05-11 16:49:13 -07:00
2026-06-06 18:44:09 -07:00
2026-06-01 01:22:38 -07:00
2026-05-31 06:14:32 -07:00
2026-06-07 21:50:57 -07:00
2026-05-27 00:43:32 -07:00
2026-05-31 17:46:56 -05:00
2026-05-08 14:27:40 -07:00
2026-06-07 08:36:48 -07:00
2026-05-10 07:09:28 -07:00
2026-05-12 20:49:20 -07:00
2026-05-16 17:59:32 -07:00
2026-06-05 20:59:36 -05:00
2026-05-12 20:46:04 -07:00
2026-05-30 20:48:41 -07:00
2026-06-02 20:23:09 +00:00
2026-05-19 00:12:41 -07:00
2026-05-18 21:38:05 -07:00
2026-06-04 06:11:22 -07:00
2026-05-18 19:36:04 -07:00
2026-06-04 06:11:22 -07:00
2026-05-28 04:53:27 -07:00
2026-05-25 23:17:33 -07:00
2026-06-05 20:59:36 -05:00
2026-05-05 04:33:38 -07:00
2026-05-04 12:07:17 -07:00
2026-05-25 14:52:24 -07:00
2026-06-03 11:22:06 -07:00
2026-05-19 00:12:12 -07:00
2026-05-13 06:46:23 -07:00
2026-05-25 01:41:19 -07:00
2026-05-25 01:41:19 -07:00
2026-05-24 18:04:54 -07:00
2026-05-24 18:04:54 -07:00
2026-06-07 22:17:35 -07:00
2026-05-28 10:31:59 -07:00
2026-05-13 16:39:41 -07:00
2026-05-13 16:39:41 -07:00
2026-05-28 04:52:42 -07:00
2026-05-28 04:52:42 -07:00