From 5479a446917a94bbc5e5ad614ce13517bc1e0016 Mon Sep 17 00:00:00 2001 From: chengyongru Date: Sun, 5 Apr 2026 17:16:54 +0800 Subject: [PATCH] fix: stop leaking reasoning_content to stream output The streaming path in OpenAICompatProvider.chat_stream() was passing reasoning_content deltas through on_content_delta(), causing model internal reasoning to be displayed to the user alongside the actual response content. reasoning_content is already collected separately in _parse_chunks() and stored in LLMResponse.reasoning_content for session history. It should never be forwarded to the user-facing stream. --- nanobot/providers/openai_compat_provider.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/nanobot/providers/openai_compat_provider.py b/nanobot/providers/openai_compat_provider.py index c9f797705..a216e9046 100644 --- a/nanobot/providers/openai_compat_provider.py +++ b/nanobot/providers/openai_compat_provider.py @@ -671,9 +671,6 @@ class OpenAICompatProvider(LLMProvider): break chunks.append(chunk) if on_content_delta and chunk.choices: - text = getattr(chunk.choices[0].delta, "reasoning_content", None) - if text: - await on_content_delta(text) text = getattr(chunk.choices[0].delta, "content", None) if text: await on_content_delta(text)