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:
@@ -3,6 +3,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from datetime import datetime, timezone
|
||||||
import base64
|
import base64
|
||||||
import contextvars
|
import contextvars
|
||||||
import json
|
import json
|
||||||
@@ -721,9 +722,11 @@ class HermesACPAgent(acp.Agent):
|
|||||||
return
|
return
|
||||||
|
|
||||||
title = row.get("title")
|
title = row.get("title")
|
||||||
updated_at = row.get("updated_at")
|
# The `sessions` table does not have an `updated_at` column (see
|
||||||
if updated_at is not None and not isinstance(updated_at, str):
|
# hermes_state.py schema — only started_at/ended_at). Use "now" as
|
||||||
updated_at = str(updated_at)
|
# 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(
|
update = SessionInfoUpdate(
|
||||||
session_update="session_info_update",
|
session_update="session_info_update",
|
||||||
title=title if isinstance(title, str) and title.strip() else None,
|
title=title if isinstance(title, str) and title.strip() else None,
|
||||||
|
|||||||
Reference in New Issue
Block a user