mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-03 12:23:08 +00:00
fix(gateway): use last_prompt_tokens for session-reset activity check
reset_had_activity gated on entry.total_tokens, which is never written (token counts migrated to agent-direct persistence) so it was always 0. That suppressed session-reset notifications for sessions that genuinely had activity. Switch to last_prompt_tokens, which is updated on every turn.
This commit is contained in:
parent
9e490138a0
commit
0fe9755016
1 changed files with 5 additions and 2 deletions
|
|
@ -1217,8 +1217,11 @@ class SessionStore:
|
|||
# Session is being auto-reset.
|
||||
was_auto_reset = True
|
||||
auto_reset_reason = reset_reason
|
||||
# Track whether the expired session had any real conversation
|
||||
reset_had_activity = entry.total_tokens > 0
|
||||
# Track whether the expired session had any real conversation.
|
||||
# total_tokens is never written (token counts migrated to
|
||||
# agent-direct persistence) so it is always 0 — use
|
||||
# last_prompt_tokens, which is updated on every turn.
|
||||
reset_had_activity = entry.last_prompt_tokens > 0
|
||||
db_end_session_id = entry.session_id
|
||||
else:
|
||||
was_auto_reset = False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue