fix(pheby): persist cron deliveries in chat display history

This commit is contained in:
2026-10-30 12:15:09 +00:00
parent 7b94342eb8
commit 7e0e510bac
4 changed files with 196 additions and 5 deletions
+12
View File
@@ -137,6 +137,18 @@ class PhebyAdapter(BasePlatformAdapter):
conversation_id = self._conv_from_chat_id(chat_id)
metadata = metadata or {}
# Scheduled sends do not belong to any active assistant draft. Save
# before broadcasting: a notification/WS event alone is not history.
if metadata.get("job_id"):
try:
event = await hermes_bridge.persist_cron_delivery(
conversation_id, content, metadata)
except Exception:
logger.exception("[pheby] cron delivery persistence failed")
return SendResult(success=False, error="Unable to save cron delivery")
await self._server.broadcast(event)
return SendResult(success=True, message_id=event["message_id"])
# Commentary and gateway notices are complete standalone timeline
# items. They must not close the primary assistant draft/run.
if metadata.get("_interim_send") or metadata.get("non_conversational"):