fix: buffer split reasoning wrapper deltas

maintainer edit: native reasoning streams can split <thinking> wrapper tags across chunks. Buffer the stream and emit only cleaned incremental reasoning so raw partial tags do not reach WebUI.
This commit is contained in:
chengyongru
2026-06-24 15:45:34 +08:00
committed by Xubin Ren
parent 35bd1be109
commit 98dd883ce8
3 changed files with 16 additions and 5 deletions
+2 -2
View File
@@ -381,8 +381,8 @@ async def test_runner_strips_thinking_tags_from_native_thinking_deltas():
*, on_content_delta=None, on_thinking_delta=None, **kwargs
):
if on_thinking_delta:
await on_thinking_delta("<thinking>")
await on_thinking_delta("Preparing final response")
await on_thinking_delta("<thinking")
await on_thinking_delta(">Preparing final response")
await on_thinking_delta("</thinking>")
if on_content_delta:
await on_content_delta("done")