fix: retry Agent Step2 once when first write attempt fails

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-03 16:40:05 +08:00
parent 64179820d7
commit db270013eb
2 changed files with 41 additions and 1 deletions

View File

@@ -125,10 +125,20 @@ def run_agent_workflow(
trends = analyze_trends(llm_input, date_str=date_str)
if not trends:
return None
return write_wecom_report(
md = write_wecom_report(
llm_input,
trends,
date_str=date_str,
time_str=time_str,
updated=updated,
)
if md is None:
logger.warning("Agent Step2 首次失败,重试一次")
md = write_wecom_report(
llm_input,
trends,
date_str=date_str,
time_str=time_str,
updated=updated,
)
return md