fix(agent-office): blog 리서치 응답 필드명 수정 (result.keyword_id → result_id)
blog-lab /task 응답은 최상위 result_id 필드를 사용하지만 중첩 result.keyword_id를 읽고 있어 리서치 성공 직후 None으로 빠져나와 "research timeout"으로 오보고되던 문제 수정. 실제 타임아웃과 파싱 실패 경로를 분리해 에러 메시지 구분. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -57,16 +57,20 @@ class BlogAgent(BaseAgent):
|
|||||||
keyword_id = None
|
keyword_id = None
|
||||||
|
|
||||||
# 2) 리서치 완료까지 폴링 (최대 3분)
|
# 2) 리서치 완료까지 폴링 (최대 3분)
|
||||||
|
timed_out = True
|
||||||
for _ in range(36):
|
for _ in range(36):
|
||||||
await asyncio.sleep(5)
|
await asyncio.sleep(5)
|
||||||
status = await service_proxy.blog_task_status(research_task_id)
|
status = await service_proxy.blog_task_status(research_task_id)
|
||||||
if status.get("status") == "succeeded":
|
if status.get("status") == "succeeded":
|
||||||
keyword_id = status.get("result", {}).get("keyword_id")
|
keyword_id = status.get("result_id")
|
||||||
|
timed_out = False
|
||||||
break
|
break
|
||||||
if status.get("status") == "failed":
|
if status.get("status") == "failed":
|
||||||
raise Exception(f"research failed: {status.get('error')}")
|
raise Exception(f"research failed: {status.get('error')}")
|
||||||
|
if timed_out:
|
||||||
|
raise Exception("research timeout (3분 내 완료되지 않음)")
|
||||||
if not keyword_id:
|
if not keyword_id:
|
||||||
raise Exception("research timeout")
|
raise Exception("research succeeded but result_id missing")
|
||||||
|
|
||||||
# 3) 작가 단계
|
# 3) 작가 단계
|
||||||
await self.transition("working", f"글 생성: {keyword}", task_id)
|
await self.transition("working", f"글 생성: {keyword}", task_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user