From fb81c51dc81b28c3cb80a8f715edcf31e40725d8 Mon Sep 17 00:00:00 2001 From: gahusb Date: Mon, 11 May 2026 08:55:12 +0900 Subject: [PATCH] =?UTF-8?q?feat(curator):=20=ED=81=90=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EC=85=98=20=ED=9B=84=20=ED=85=94=EB=A0=88=EA=B7=B8=EB=9E=A8=20?= =?UTF-8?q?=EC=9E=90=EB=8F=99=20=ED=91=B8=EC=8B=9C=20+=20cron=2009:00=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- agent-office/app/agents/lotto.py | 14 ++++++++++++-- agent-office/app/scheduler.py | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) 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")