[GH-ISSUE #20231] issue: Non-streaming responses with thinking enabled are not parsed correctly (thinking content merged into final answer) #57799

Closed
opened 2026-05-05 21:38:10 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @hamid370 on GitHub (Dec 29, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20231

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

Installation Method

Git Clone

Open WebUI Version

latest

Ollama Version (if applicable)

No response

Operating System

ubuntu

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

Bug description

When using OpenWebUI with models that support thinking / reasoning output (e.g. <think>...</think> blocks), non-streaming responses (stream: false) are not parsed correctly.

Instead of separating the thinking section from the final answer, OpenWebUI treats the entire response — including the <think>...</think> block — as the final visible answer.

This results in internal reasoning content being shown directly to the user.


Expected behavior

When thinking (or reasoning mode) is enabled and the request is sent with stream: false:

  • The <think>...</think> block should be recognized and extracted
  • The thinking content should be handled internally (or hidden, depending on UI settings)
  • Only the final answer text (content after </think>) should be displayed as the assistant’s response

Reproduction steps

  1. Enable a model that outputs reasoning in <think>...</think> format

  2. Enable thinking / reasoning in model or UI settings

  3. Send a request with:

    • stream: false
  4. Observe that OpenWebUI displays the entire response including <think> content


Environment

  • UI: OpenWebUI
  • Request mode: Non-streaming (stream: false)
  • Model behavior: Returns <think>...</think> reasoning blocks
  • Upstream API: OpenAI-compatible (/v1/chat/completions)

Notes / suspicion

This appears to be a parsing issue specific to non-streaming responses.
In streaming mode, reasoning/thinking blocks are usually handled token-by-token, but in non-streaming mode the final text is not post-processed to separate <think> content from the actual assistant answer.

A post-processing step for non-stream responses that strips or separates <think>...</think> blocks would resolve this.


  • Streaming responses may already handle reasoning tokens correctly

  • Issue only occurs when:

    • thinking is enabled
    • stream: false is used

Actual Behavior

Repository: open-webui/open-webui
Where to post: GitHub → IssuesNew issueBug report


Title

Non-streaming responses with thinking enabled are not parsed correctly (thinking content merged into final answer)


Bug description

When using OpenWebUI with models that support thinking / reasoning output (e.g. <think>...</think> blocks), non-streaming responses (stream: false) are not parsed correctly.

Instead of separating the thinking section from the final answer, OpenWebUI treats the entire response — including the <think>...</think> block — as the final visible answer.

This results in internal reasoning content being shown directly to the user.


Expected behavior

When thinking (or reasoning mode) is enabled and the request is sent with stream: false:

  • The <think>...</think> block should be recognized and extracted
  • The thinking content should be handled internally (or hidden, depending on UI settings)
  • Only the final answer text (content after </think>) should be displayed as the assistant’s response

Actual behavior

For non-streaming requests with thinking enabled:

  • OpenWebUI does not split or parse the <think>...</think> section
  • The entire raw response is displayed as-is
  • Both the thinking content and the final answer are merged and shown together

Example of what OpenWebUI currently displays:

<think>
Okay, the user wants a code snippet for a sticky header using CSS and JavaScript.
Let me think about how to approach this.
...
I think that's a solid approach. Let me write the code now.
</think>

Here's a complete code snippet that demonstrates a sticky header using CSS and JavaScript...

Expected output (conceptually)

  • Hidden / internal:
<think>
Okay, the user wants a code snippet for a sticky header using CSS and JavaScript.
...
</think>
  • Visible to user:
Here's a complete code snippet that demonstrates a sticky header using CSS and JavaScript...

Reproduction steps

  1. Enable a model that outputs reasoning in <think>...</think> format

  2. Enable thinking / reasoning in model or UI settings

  3. Send a request with:

    • stream: false
  4. Observe that OpenWebUI displays the entire response including <think> content


Environment

  • UI: OpenWebUI
  • Request mode: Non-streaming (stream: false)
  • Model behavior: Returns <think>...</think> reasoning blocks
  • Upstream API: OpenAI-compatible (/v1/chat/completions)

Notes / suspicion

This appears to be a parsing issue specific to non-streaming responses.
In streaming mode, reasoning/thinking blocks are usually handled token-by-token, but in non-streaming mode the final text is not post-processed to separate <think> content from the actual assistant answer.

A post-processing step for non-stream responses that strips or separates <think>...</think> blocks would resolve this.


  • Streaming responses may already handle reasoning tokens correctly

  • Issue only occurs when:

    • thinking is enabled
    • stream: false is used

Steps to Reproduce

Steps to Reproduce
Prerequisites

OpenWebUI running

OpenWebUI must be installed and running (Docker or bare-metal).

You must be able to access the UI from a browser.

An OpenAI-compatible upstream that returns ... in the assistant content

Any OpenAI-compatible API works as long as the final assistant message contains a ... block followed by the final answer text.

Example models: Qwen3 (thinking enabled), DeepSeek-style reasoning models, or any model configured to emit blocks.

Streaming must be disabled for the test request

The request must be sent as non-streaming (stream: false).

Logs & Screenshots

.

Additional Information

No response

Originally created by @hamid370 on GitHub (Dec 29, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/20231 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### Installation Method Git Clone ### Open WebUI Version latest ### Ollama Version (if applicable) _No response_ ### Operating System ubuntu ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior ## Bug description When using **OpenWebUI** with models that support **thinking / reasoning output** (e.g. `<think>...</think>` blocks), **non-streaming** responses (`stream: false`) are not parsed correctly. Instead of separating the **thinking section** from the **final answer**, OpenWebUI treats the entire response — including the `<think>...</think>` block — as the final visible answer. This results in internal reasoning content being shown directly to the user. --- ## Expected behavior When `thinking` (or reasoning mode) is enabled and the request is sent with `stream: false`: * The `<think>...</think>` block should be **recognized and extracted** * The **thinking content** should be handled internally (or hidden, depending on UI settings) * Only the **final answer text** (content after `</think>`) should be displayed as the assistant’s response --- ## Reproduction steps 1. Enable a model that outputs reasoning in `<think>...</think>` format 2. Enable **thinking / reasoning** in model or UI settings 3. Send a request with: * `stream: false` 4. Observe that OpenWebUI displays the entire response including `<think>` content --- ## Environment * **UI:** OpenWebUI * **Request mode:** Non-streaming (`stream: false`) * **Model behavior:** Returns `<think>...</think>` reasoning blocks * **Upstream API:** OpenAI-compatible (`/v1/chat/completions`) --- ## Notes / suspicion This appears to be a **parsing issue specific to non-streaming responses**. In streaming mode, reasoning/thinking blocks are usually handled token-by-token, but in non-streaming mode the final text is not post-processed to separate `<think>` content from the actual assistant answer. A post-processing step for non-stream responses that strips or separates `<think>...</think>` blocks would resolve this. --- ## Related behavior * Streaming responses may already handle reasoning tokens correctly * Issue only occurs when: * `thinking` is enabled * `stream: false` is used ### Actual Behavior **Repository:** `open-webui/open-webui` **Where to post:** GitHub → **Issues** → **New issue** → **Bug report** --- ## Title Non-streaming responses with `thinking` enabled are not parsed correctly (thinking content merged into final answer) --- ## Bug description When using **OpenWebUI** with models that support **thinking / reasoning output** (e.g. `<think>...</think>` blocks), **non-streaming** responses (`stream: false`) are not parsed correctly. Instead of separating the **thinking section** from the **final answer**, OpenWebUI treats the entire response — including the `<think>...</think>` block — as the final visible answer. This results in internal reasoning content being shown directly to the user. --- ## Expected behavior When `thinking` (or reasoning mode) is enabled and the request is sent with `stream: false`: * The `<think>...</think>` block should be **recognized and extracted** * The **thinking content** should be handled internally (or hidden, depending on UI settings) * Only the **final answer text** (content after `</think>`) should be displayed as the assistant’s response --- ## Actual behavior For non-streaming requests with `thinking` enabled: * OpenWebUI does **not** split or parse the `<think>...</think>` section * The entire raw response is displayed as-is * Both the **thinking content** and the **final answer** are merged and shown together Example of what OpenWebUI currently displays: ```text <think> Okay, the user wants a code snippet for a sticky header using CSS and JavaScript. Let me think about how to approach this. ... I think that's a solid approach. Let me write the code now. </think> Here's a complete code snippet that demonstrates a sticky header using CSS and JavaScript... ``` --- ## Expected output (conceptually) * **Hidden / internal:** ```text <think> Okay, the user wants a code snippet for a sticky header using CSS and JavaScript. ... </think> ``` * **Visible to user:** ```text Here's a complete code snippet that demonstrates a sticky header using CSS and JavaScript... ``` --- ## Reproduction steps 1. Enable a model that outputs reasoning in `<think>...</think>` format 2. Enable **thinking / reasoning** in model or UI settings 3. Send a request with: * `stream: false` 4. Observe that OpenWebUI displays the entire response including `<think>` content --- ## Environment * **UI:** OpenWebUI * **Request mode:** Non-streaming (`stream: false`) * **Model behavior:** Returns `<think>...</think>` reasoning blocks * **Upstream API:** OpenAI-compatible (`/v1/chat/completions`) --- ## Notes / suspicion This appears to be a **parsing issue specific to non-streaming responses**. In streaming mode, reasoning/thinking blocks are usually handled token-by-token, but in non-streaming mode the final text is not post-processed to separate `<think>` content from the actual assistant answer. A post-processing step for non-stream responses that strips or separates `<think>...</think>` blocks would resolve this. --- ## Related behavior * Streaming responses may already handle reasoning tokens correctly * Issue only occurs when: * `thinking` is enabled * `stream: false` is used ### Steps to Reproduce Steps to Reproduce Prerequisites OpenWebUI running OpenWebUI must be installed and running (Docker or bare-metal). You must be able to access the UI from a browser. An OpenAI-compatible upstream that returns <think>...</think> in the assistant content Any OpenAI-compatible API works as long as the final assistant message contains a <think>...</think> block followed by the final answer text. Example models: Qwen3 (thinking enabled), DeepSeek-style reasoning models, or any model configured to emit <think> blocks. Streaming must be disabled for the test request The request must be sent as non-streaming (stream: false). ### Logs & Screenshots . ### Additional Information _No response_
GiteaMirror added the bug label 2026-05-05 21:38:11 -05:00
Author
Owner

@owui-terminator[bot] commented on GitHub (Dec 29, 2025):

🔍 Similar Issues Found

I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:

  1. #19861 issue:
    by QuitHub • Dec 10, 2025 • bug

  2. #19877 issue:
    by dotmobo • Dec 11, 2025 • bug

  3. #19738 issue: Thinking models render responses inside thinking UI when using native tools
    by qq3829596922 • Dec 04, 2025 • bug

  4. #20019 issue:
    by j63440490 • Dec 17, 2025 • bug

  5. #19777 issue:
    by Yaute7 • Dec 05, 2025 • bug

Show 5 more related issues
  1. #20092 issue:
    by VideoRyan • Dec 22, 2025 • bug

  2. #20046 issue:
    by pierrelouisbescond • Dec 19, 2025 • bug

  3. #20155 issue:
    by dhaern • Dec 24, 2025 • bug

  4. #20059 issue: Chat response is not working
    by navilg • Dec 20, 2025 • bug

  5. #20107 issue:
    by mengdeer589 • Dec 22, 2025 • bug


💡 Tips:

  • If this is a duplicate, please consider closing this issue and adding any additional details to the existing one
  • If you found a solution in any of these issues, please share it here to help others

This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.

<!-- gh-comment-id:3695457550 --> @owui-terminator[bot] commented on GitHub (Dec 29, 2025): 🔍 **Similar Issues Found** I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions: 1. [#19861](https://github.com/open-webui/open-webui/issues/19861) **issue:** *by QuitHub • Dec 10, 2025 • `bug`* 2. [#19877](https://github.com/open-webui/open-webui/issues/19877) **issue:** *by dotmobo • Dec 11, 2025 • `bug`* 3. [#19738](https://github.com/open-webui/open-webui/issues/19738) **issue: Thinking models render responses inside thinking UI when using native tools** *by qq3829596922 • Dec 04, 2025 • `bug`* 4. [#20019](https://github.com/open-webui/open-webui/issues/20019) **issue:** *by j63440490 • Dec 17, 2025 • `bug`* 5. [#19777](https://github.com/open-webui/open-webui/issues/19777) **issue:** *by Yaute7 • Dec 05, 2025 • `bug`* <details> <summary>Show 5 more related issues</summary> 6. [#20092](https://github.com/open-webui/open-webui/issues/20092) **issue:** *by VideoRyan • Dec 22, 2025 • `bug`* 7. [#20046](https://github.com/open-webui/open-webui/issues/20046) **issue:** *by pierrelouisbescond • Dec 19, 2025 • `bug`* 8. [#20155](https://github.com/open-webui/open-webui/issues/20155) **issue:** *by dhaern • Dec 24, 2025 • `bug`* 9. [#20059](https://github.com/open-webui/open-webui/issues/20059) **issue: Chat response is not working** *by navilg • Dec 20, 2025 • `bug`* 10. [#20107](https://github.com/open-webui/open-webui/issues/20107) **issue:** *by mengdeer589 • Dec 22, 2025 • `bug`* </details> --- 💡 **Tips:** - If this is a duplicate, please consider closing this issue and adding any additional details to the existing one - If you found a solution in any of these issues, please share it here to help others *This comment was generated automatically by a bot.* Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
Author
Owner

@tjbck commented on GitHub (Dec 30, 2025):

Intended behaviour.

<!-- gh-comment-id:3698617861 --> @tjbck commented on GitHub (Dec 30, 2025): Intended behaviour.
Author
Owner

@DefinitlyEvil commented on GitHub (Jan 4, 2026):

So this is intended but no one is pointing to a resolution? I used --reasoning-parser 'qwen3' (tried deepseek_v3 as well) it did not work as it should. Changing chat template is not optimal.

Edit: Use --reasoning-parser deepseek_r1.

<!-- gh-comment-id:3708064432 --> @DefinitlyEvil commented on GitHub (Jan 4, 2026): So this is intended but no one is pointing to a resolution? I used `--reasoning-parser 'qwen3'` (tried `deepseek_v3` as well) it did not work as it should. Changing chat template is not optimal. Edit: Use `--reasoning-parser deepseek_r1`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#57799