[GH-ISSUE #16435] issue: Qwen3 and Qwen3-Coder output sometimes causes formatting of code sections in UI to go very wrong #17903

Closed
opened 2026-04-19 23:47:38 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @xkmire on GitHub (Aug 10, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/16435

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.6.18 (latest)

Ollama Version (if applicable)

latest llama.cpp

Operating System

Ubuntu 25.04

Browser (if applicable)

Google chrome

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

When Qwen3 outputs a code segment, I expect the code segment to look like code, even if there are some markdown formated text blocks coming after.

Actual Behavior

When Qwen3 outputs code, there is sometimes (quite frequently) some markdown text after. When that text is rendered in the UI the code block becomes completely unreadable in a big font without line breaks.
In the example below, the first code block gets broken in the UI, but the second looks great:

Here's your Go code converted into a well-formatted, readable, and commented version for better understanding:

func processBuffer(buf []byte, w io.Writer) {
}

Notes:

  • Purpose: This function is typically used to process Server-Sent Events (SSE) from an API stream (like OpenAI's chat completions), where each event is formatted as data: {...} or data: [DONE].
  • Assumptions:
    • StreamChunk is a struct defined elsewhere, likely like:
      type StreamChunk struct {
          Choices []struct {
          } `json:"choices"`
      }
      
    • The w parameter is an io.Writer (e.g., os.Stdout, a buffer, etc.).
  • Output: Prints and writes only the textual content chunks as they arrive.
    Let me know if you'd like the full struct definitions or error handling improvements!

Steps to Reproduce

  1. Install latest open webui docker on ubuntu 25.04 using latest Google Chrome browser
    (In this case, I think the only important part is the open webui version and maybe the browser)
  2. Ask Qwen3 or Qwen3-Coder some questions about generating code and see the output sometimes gets distorted

Logs & Screenshots

Image

Additional Information

No response

Originally created by @xkmire on GitHub (Aug 10, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/16435 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v0.6.18 (latest) ### Ollama Version (if applicable) latest llama.cpp ### Operating System Ubuntu 25.04 ### Browser (if applicable) Google chrome ### 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 When Qwen3 outputs a code segment, I expect the code segment to look like code, even if there are some markdown formated text blocks coming after. ### Actual Behavior When Qwen3 outputs code, there is sometimes (quite frequently) some markdown text after. When that text is rendered in the UI the code block becomes completely unreadable in a big font without line breaks. In the example below, the first code block gets broken in the UI, but the second looks great: Here's your Go code converted into a **well-formatted, readable, and commented** version for better understanding: ```go func processBuffer(buf []byte, w io.Writer) { } ``` --- ### Notes: - **Purpose**: This function is typically used to process Server-Sent Events (SSE) from an API stream (like OpenAI's chat completions), where each event is formatted as `data: {...}` or `data: [DONE]`. - **Assumptions**: - `StreamChunk` is a struct defined elsewhere, likely like: ```go type StreamChunk struct { Choices []struct { } `json:"choices"` } ``` - The `w` parameter is an `io.Writer` (e.g., `os.Stdout`, a buffer, etc.). - **Output**: Prints and writes only the textual content chunks as they arrive. Let me know if you'd like the full struct definitions or error handling improvements! ### Steps to Reproduce 1) Install latest open webui docker on ubuntu 25.04 using latest Google Chrome browser (In this case, I think the only important part is the open webui version and maybe the browser) 2) Ask Qwen3 or Qwen3-Coder some questions about generating code and see the output sometimes gets distorted ### Logs & Screenshots <img width="1591" height="1631" alt="Image" src="https://github.com/user-attachments/assets/24a23f2b-b3ee-4953-a3b3-4386ccf303b2" /> ### Additional Information _No response_
GiteaMirror added the bug label 2026-04-19 23:47:38 -05:00
Author
Owner

@tjbck commented on GitHub (Aug 10, 2025):

Model dependent behaviour, could you confirm this isn't a model response issue?

<!-- gh-comment-id:3172540810 --> @tjbck commented on GitHub (Aug 10, 2025): Model dependent behaviour, could you confirm this isn't a model response issue?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#17903