fix: 修复重复显示的bug

This commit is contained in:
ViperEkura 2026-04-25 16:58:18 +08:00
parent 3e5c76cd83
commit 740f265237
1 changed files with 4 additions and 2 deletions

View File

@ -155,11 +155,13 @@ class AgenticLoop:
if thinking:
ctx.full_thinking += thinking
if ctx.current_step_type != StepType.THINKING:
ctx.start_step(StepType.THINKING)
events.append(StreamRenderer.render_thinking(ctx))
ctx.finalize_step()
if text:
ctx.full_content += text
if ctx.current_step_type != StepType.TEXT:
ctx.start_step(StepType.TEXT)
events.append(StreamRenderer.render_text(ctx))
ctx.finalize_step()