Skip to content

Commit 08d8891

Browse files
authored
Merge pull request #672 from AnguseZhang/fix/GeneratorExit_ERROR
refactor: 简化异步报告事件处理代码以提高可读性
2 parents 85524e0 + c2e6250 commit 08d8891

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

  • agents/matmaster_agent/flow_agents

agents/matmaster_agent/flow_agents/agent.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -590,13 +590,8 @@ async def _run_plan_execute_and_summary_agent(
590590
# Collect report Markdown
591591
report_markdown = ''
592592
async for report_event in self.report_agent.run_async(ctx):
593-
current_text = is_text(report_event)
594-
if not current_text:
595-
continue
596-
597-
report_markdown = current_text
598-
if not report_event.partial:
599-
break
593+
if (cur_text := is_text(report_event)) and not report_event.partial:
594+
report_markdown += cur_text
600595

601596
# matmaster_report_md.md
602597
upload_result = await upload_report_md_to_oss(

0 commit comments

Comments
 (0)