fix(webui): merge length recovery stream segments

This commit is contained in:
chengyongru authored and Xubin Ren committed 2026-07-27 01:39:46 +08:00
1 parent 3cc5a98d9f
commit 27a00c7a4f
26 files changed
+325 -29

No files matched your search

+7 -1
View File
@@ -85,7 +85,13 @@ class AgentProgressHook(AgentHook):
async def on_stream_end(self, context: AgentHookContext, *, resuming: bool) -> None:
await self.emit_reasoning_end()
if self._on_stream_end:
await self._on_stream_end(resuming=resuming)
kwargs: dict[str, bool] = {"resuming": resuming}
if (
context.stream_continues_current_message
and self._on_progress_accepts(self._on_stream_end, "merge_next")
):
kwargs["merge_next"] = True
await self._on_stream_end(**kwargs)
self._stream_buf = ""
self._think_extractor.reset()