fix(agent): 流式+啰嗦模式下渠道不支持编辑时立即发送工具消息

渠道不支持编辑时没有定时刷新任务,emit 到 buffer 的内容不会被推送。
新增 can_edit_message 属性区分两种模式:支持编辑的继续 emit 到 buffer,
不支持编辑的 take 出 agent 文字与工具消息合并独立发送。
This commit is contained in:
jxxghp
2026-04-09 23:26:39 +08:00
parent aafc4b3a39
commit 22f3244bf5
2 changed files with 22 additions and 3 deletions

View File

@@ -347,6 +347,13 @@ class StreamingHandler:
"""
return self._streaming_enabled
@property
def can_edit_message(self) -> bool:
"""
是否支持消息编辑(实时推送),即定时刷新任务正在运行
"""
return self._flush_task is not None
@property
def has_sent_message(self) -> bool:
"""