fix(agent-office): on_ai_news_schedule — graceful fail on missing telegram_text
This commit is contained in:
@@ -307,7 +307,10 @@ class StockAgent(BaseAgent):
|
|||||||
# 정상 — Top 5 메시지 (stock-lab이 빌드해서 응답에 telegram_text 동봉)
|
# 정상 — Top 5 메시지 (stock-lab이 빌드해서 응답에 telegram_text 동봉)
|
||||||
text = result.get("telegram_text") or ""
|
text = result.get("telegram_text") or ""
|
||||||
if not text:
|
if not text:
|
||||||
raise RuntimeError("telegram_text 누락")
|
add_log(self.agent_id, "telegram_text 누락 — stock-lab 응답 결함", "error", task_id)
|
||||||
|
update_task_status(task_id, "failed", {"error": "telegram_text 누락"})
|
||||||
|
await self.transition("idle", "AI 뉴스 응답 결함")
|
||||||
|
return
|
||||||
|
|
||||||
await self.transition("reporting", "AI 뉴스 알림 전송 중...")
|
await self.transition("reporting", "AI 뉴스 알림 전송 중...")
|
||||||
from ..telegram.messaging import send_raw
|
from ..telegram.messaging import send_raw
|
||||||
|
|||||||
Reference in New Issue
Block a user