mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-29 06:31:32 +00:00
fix(acp): use refresh moment as updated_at on session info push
Follow-up to #26543. The sessions table does not have an updated_at column (see hermes_state.py — only started_at/ended_at), so row.get('updated_at') always returned None and the str() coercion was dead code. Use datetime.now(UTC).isoformat() instead, which reflects exactly what the field means here: 'the title was refreshed at this moment'. Drop the dead coercion.
This commit is contained in:
parent
741a349458
commit
2057977102
1 changed files with 6 additions and 3 deletions
|
|
@ -3,6 +3,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from datetime import datetime, timezone
|
||||
import base64
|
||||
import contextvars
|
||||
import json
|
||||
|
|
@ -721,9 +722,11 @@ class HermesACPAgent(acp.Agent):
|
|||
return
|
||||
|
||||
title = row.get("title")
|
||||
updated_at = row.get("updated_at")
|
||||
if updated_at is not None and not isinstance(updated_at, str):
|
||||
updated_at = str(updated_at)
|
||||
# The `sessions` table does not have an `updated_at` column (see
|
||||
# hermes_state.py schema — only started_at/ended_at). Use "now" as
|
||||
# the updated_at since we're emitting this notification precisely
|
||||
# because the title was just refreshed.
|
||||
updated_at = datetime.now(timezone.utc).isoformat()
|
||||
update = SessionInfoUpdate(
|
||||
session_update="session_info_update",
|
||||
title=title if isinstance(title, str) and title.strip() else None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue