diff --git a/agent-office/app/agents/blog.py b/agent-office/app/agents/blog.py index 0223671..e8645bf 100644 --- a/agent-office/app/agents/blog.py +++ b/agent-office/app/agents/blog.py @@ -57,16 +57,20 @@ class BlogAgent(BaseAgent): keyword_id = None # 2) 리서치 완료까지 폴링 (최대 3분) + timed_out = True for _ in range(36): await asyncio.sleep(5) status = await service_proxy.blog_task_status(research_task_id) if status.get("status") == "succeeded": - keyword_id = status.get("result", {}).get("keyword_id") + keyword_id = status.get("result_id") + timed_out = False break if status.get("status") == "failed": raise Exception(f"research failed: {status.get('error')}") + if timed_out: + raise Exception("research timeout (3분 내 완료되지 않음)") if not keyword_id: - raise Exception("research timeout") + raise Exception("research succeeded but result_id missing") # 3) 작가 단계 await self.transition("working", f"글 생성: {keyword}", task_id)