Fire automation events across API routers
FlowDeck CI / lint (push) Failing after 1m12s
FlowDeck CI / test (push) Failing after 3h3m3s
FlowDeck CI / docker (push) Skipped

This commit is contained in:
2026-09-21 20:30:05 -04:00
parent 189ed5bbca
commit e0237e576f
8 changed files with 202 additions and 2 deletions
+11
View File
@@ -259,6 +259,17 @@ class AgentEngine:
self._persist_message(conversation_id, "assistant", final_text,
model=used_model, tokens=self._tokens)
await self._autotitle(conversation_id, objective, final_text)
# v6.4.0: emit agent.run.finished (outbound webhooks only).
try:
from app.services.webhook_outbound import fire_event as _fire_wh
await _fire_wh("agent.run.finished", {
"conversation_id": conversation_id,
"objective": objective[:500],
"model": used_model,
"tokens": self._tokens,
})
except Exception: # noqa: BLE001
logger.debug("agent.run.finished webhook dispatch failed")
except Exception as exc: # noqa: BLE001
logger.exception("AgentEngine run failed")