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:
teknium1 2026-05-18 11:45:35 -07:00 committed by Teknium
parent 741a349458
commit 2057977102

View file

@ -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,