Markdown <think> Folding Hides Subsequent Text in Streaming Output #3536

Closed
opened 2025-11-11 15:33:33 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @konbakuyomu on GitHub (Feb 2, 2025).

Bug Report

Installation Method

I deployed Open WebUI using Docker Compose on Ubuntu 22.04.

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on the latest version of both Open WebUI v0.5.7.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided the exact steps to reproduce the bug in the “Steps to Reproduce” section below.

Expected Behavior

When a large language model’s stream output contains chain-of-thought data wrapped in <think> ... </think>, I expect the text after </think> (i.e., the main answer content) to display correctly without being folded or “swallowed.” Ideally, the <think> section would fold neatly (e.g., using a collapsible code block or <details>), while the subsequent text remains fully visible.

Actual Behavior

Currently, whenever the chain-of-thought is folded, the text after the </think> tag appears hidden or overlapped. As a result, part of the answer that comes after the chain-of-thought is either not rendered or is truncated on the interface. The raw transmission itself seems intact, but the display causes the answer to be “swallowed.”

Description

Bug Summary:

  • The <think> markdown folding feature inadvertently hides or cuts off the text that follows it.

  • This happens specifically in a streaming output scenario where the model returns something like:

    <details type="reasoning" done="true" duration="0">
    
Thought for 0 seconds > [chain-of-thought content] [answer content] ```

Reproduction Details

Steps to Reproduce:

  1. Deploy Open WebUI on Ubuntu 22.04 using Docker Compose (following the setup instructions).
  2. Run a large language model that returns a streamed response containing <think> ... </think> blocks followed by more text.
  3. Observe that the UI folds the <think> content but also removes or hides the subsequent text after </think>.

Logs and Screenshots

Screenshots/Screen Recordings:
Image

Additional Information

  • Tried different models but the same markdown folding issue appears for all chain-of-thought outputs.
  • Potential workaround: manually editing the output to replace <think> with a different folding approach (e.g., <details>), but that’s not ideal for streaming or user experience.

Note

Thank you for looking into this! If any additional information or logs are needed, feel free to let me know.

Originally created by @konbakuyomu on GitHub (Feb 2, 2025). # Bug Report ## Installation Method I deployed Open WebUI using **Docker Compose** on **Ubuntu 22.04**. **Confirmation:** - [ ] I have read and followed all the instructions provided in the README.md. - [ ] I am on the latest version of both Open WebUI v0.5.7. - [ ] I have included the browser console logs. - [ ] I have included the Docker container logs. - [ ] I have provided the exact steps to reproduce the bug in the “Steps to Reproduce” section below. ## Expected Behavior When a large language model’s stream output contains chain-of-thought data wrapped in `<think> ... </think>`, I expect the text after `</think>` (i.e., the main answer content) to display correctly without being folded or “swallowed.” Ideally, the `<think>` section would fold neatly (e.g., using a collapsible code block or `<details>`), while the subsequent text remains fully visible. ## Actual Behavior Currently, whenever the chain-of-thought is folded, the text after the `</think>` tag appears hidden or overlapped. As a result, part of the answer that comes after the chain-of-thought is either not rendered or is truncated on the interface. The raw transmission itself seems intact, but the display causes the answer to be “swallowed.” ## Description **Bug Summary:** - The `<think>` markdown folding feature inadvertently hides or cuts off the text that follows it. - This happens specifically in a streaming output scenario where the model returns something like: ``` <details type="reasoning" done="true" duration="0"> <summary>Thought for 0 seconds</summary> > [chain-of-thought content] </details> [answer content] ``` ## Reproduction Details **Steps to Reproduce:** 1. Deploy Open WebUI on Ubuntu 22.04 using Docker Compose (following the setup instructions). 2. Run a large language model that returns a streamed response containing `<think> ... </think>` blocks followed by more text. 3. Observe that the UI folds the `<think>` content but also removes or hides the subsequent text after `</think>`. ## Logs and Screenshots **Screenshots/Screen Recordings:** ![Image](https://github.com/user-attachments/assets/10f867b9-06cc-4666-bb96-00eac75ff98e) ## Additional Information - Tried different models but the same markdown folding issue appears for all chain-of-thought outputs. - Potential workaround: manually editing the output to replace `<think>` with a different folding approach (e.g., `<details>`), but that’s not ideal for streaming or user experience. ## Note Thank you for looking into this! If any additional information or logs are needed, feel free to let me know.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#3536