diff --git a/agent-office/app/agents/lotto.py b/agent-office/app/agents/lotto.py index ec858e1..b8f9f15 100644 --- a/agent-office/app/agents/lotto.py +++ b/agent-office/app/agents/lotto.py @@ -27,11 +27,21 @@ class LottoAgent(BaseAgent): await self.transition("working", "후보 수집 및 AI 큐레이션 중...", task_id) try: result = await curate_weekly(source=source) - update_task_status(task_id, "succeeded", result_data=result) + update_task_status(task_id, "succeeded", result_data={ + k: v for k, v in result.items() if k != "payload" + }) await self.transition("reporting", f"#{result['draw_no']} 브리핑 저장 완료") add_log(self.agent_id, f"큐레이션 완료: #{result['draw_no']} conf={result['confidence']}", task_id=task_id) + + # 텔레그램 헤드라인 푸시 (실패해도 큐레이션은 성공으로 마감) + try: + from ..notifiers.telegram_lotto import send_curator_briefing + await send_curator_briefing(result["payload"]) + except Exception as e: + add_log(self.agent_id, f"텔레그램 알림 실패: {e}", level="warning", task_id=task_id) + await self.transition("idle", "대기 중") - return {"ok": True, **result} + return {"ok": True, **{k: v for k, v in result.items() if k != "payload"}} except CuratorError as e: update_task_status(task_id, "failed", result_data={"error": str(e)}) add_log(self.agent_id, f"큐레이션 실패: {e}", level="error", task_id=task_id) diff --git a/agent-office/app/scheduler.py b/agent-office/app/scheduler.py index afab21a..c1c265c 100644 --- a/agent-office/app/scheduler.py +++ b/agent-office/app/scheduler.py @@ -42,7 +42,7 @@ async def _poll_pipelines(): def init_scheduler(): scheduler.add_job(_run_stock_schedule, "cron", hour=7, minute=30, id="stock_news") scheduler.add_job(_run_blog_schedule, "cron", hour=10, minute=0, id="blog_pipeline") - scheduler.add_job(_run_lotto_schedule, "cron", day_of_week="mon", hour=7, minute=0, id="lotto_curate") + scheduler.add_job(_run_lotto_schedule, "cron", day_of_week="mon", hour=9, minute=0, id="lotto_curate") scheduler.add_job(_run_youtube_research, "cron", hour=9, minute=0, id="youtube_research") scheduler.add_job(_send_youtube_weekly_report, "cron", day_of_week="mon", hour=8, minute=0, id="youtube_weekly_report") scheduler.add_job(_check_idle_breaks, "interval", seconds=60, id="idle_check")