fix(pheby): persist cron deliveries in chat display history
This commit is contained in:
@@ -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"):
|
||||
|
||||
Reference in New Issue
Block a user