[GH-ISSUE #22267] issue: HTML Preview renders code blocks inside thinking blocks for certain models #58348

Closed
opened 2026-05-05 22:59:10 -05:00 by GiteaMirror · 11 comments
Owner

Originally created by @adhusch on GitHub (Mar 5, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22267

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

Docker

Open WebUI Version

v0.8.8

Ollama Version (if applicable)

No response

Operating System

N/A

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

Thinking models of all popular vendors should correctly output artifacts

Actual Behavior

Several thinking models produce an addtional block of raw code output in the artifact frame before the actual artifact, containing many addtional ">" symbols, exactly as described in #20801

Steps to Reproduce

  1. Select a thinking model from Mistral (e.g. Magistral, Ministral Reasoning) or Z.ai (e.g. GLM 4.7), likely also other vendors affected but not known today
  2. Prompt the model to create an HTML output, e.g. "Generate a simple HTML page with button labelled click-me"
  3. Observe that the artifact frame contains the code-output from the thinking block with many > stray characters before the actual expected artifact output

Logs & Screenshots

See screenshots in #20801

Additional Information

No response

Originally created by @adhusch on GitHub (Mar 5, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/22267 ### 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 Docker ### Open WebUI Version v0.8.8 ### Ollama Version (if applicable) _No response_ ### Operating System N/A ### 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 Thinking models of all popular vendors should correctly output artifacts ### Actual Behavior Several thinking models produce an addtional block of raw code output in the artifact frame before the actual artifact, containing many addtional ">" symbols, exactly as described in #20801 ### Steps to Reproduce 1. Select a thinking model from Mistral (e.g. Magistral, Ministral Reasoning) or Z.ai (e.g. GLM 4.7), likely also other vendors affected but not known today 2. Prompt the model to create an HTML output, e.g. "Generate a simple HTML page with button labelled click-me" 3. Observe that the artifact frame contains the code-output from the thinking block with many > stray characters before the actual expected artifact output ### Logs & Screenshots See screenshots in #20801 ### Additional Information _No response_
GiteaMirror added the bug label 2026-05-05 22:59:10 -05:00
Author
Owner

@ShirasawaSama commented on GitHub (Mar 7, 2026):

I've encountered the same issue, particularly with Google Gemini 3's reasoning process. Since each line of its reasoning chain begins with a “<” character, this prevents the previewed webpage from being displayed.

<!-- gh-comment-id:4015891939 --> @ShirasawaSama commented on GitHub (Mar 7, 2026): I've encountered the same issue, particularly with Google Gemini 3's reasoning process. Since each line of its reasoning chain begins with a “<” character, this prevents the previewed webpage from being displayed.
Author
Owner

@tjbck commented on GitHub (Mar 8, 2026):

Should be addressed in dev, testing wanted here.

<!-- gh-comment-id:4017730742 --> @tjbck commented on GitHub (Mar 8, 2026): Should be addressed in dev, testing wanted here.
Author
Owner

@Classic298 commented on GitHub (Mar 8, 2026):

35bc831077

<!-- gh-comment-id:4017732161 --> @Classic298 commented on GitHub (Mar 8, 2026): https://github.com/open-webui/open-webui/commit/35bc8310772c222fd8a466f7d00113a84e0402d0
Author
Owner

@adhusch commented on GitHub (Mar 9, 2026):

Thank you! @Classic298 Tested with Mistral Models in 0.8.10, problem unfortunatly still exists for them.

<!-- gh-comment-id:4021780461 --> @adhusch commented on GitHub (Mar 9, 2026): Thank you! @Classic298 Tested with Mistral Models in 0.8.10, problem unfortunatly **still exists** for them.
Author
Owner

@Classic298 commented on GitHub (Mar 9, 2026):

Ways to reproduce?

<!-- gh-comment-id:4021797006 --> @Classic298 commented on GitHub (Mar 9, 2026): Ways to reproduce?
Author
Owner

@adhusch commented on GitHub (Mar 9, 2026):

As described above, just try with a Mistral reasoning model, e.g. Magistral. Thx.

<!-- gh-comment-id:4021804698 --> @adhusch commented on GitHub (Mar 9, 2026): As described above, just try with a Mistral reasoning model, e.g. Magistral. Thx.
Author
Owner

@Classic298 commented on GitHub (Mar 9, 2026):

any prompt in particular? Can i try with mistral large?

<!-- gh-comment-id:4021826706 --> @Classic298 commented on GitHub (Mar 9, 2026): any prompt in particular? Can i try with mistral large?
Author
Owner

@adhusch commented on GitHub (Mar 9, 2026):

Thank you! Something like "Generate a simple HTML page with button labelled click-me". Never tried with Mistral Large, but should be similar if it uses the same reasoning format. Are you referrig to Mistral Large 3? As Ministral 3 is affected i would expect the whole Mistral 3 model familiy.

@motosir you had reported same issue with GLM 4.7. Is this fixed?

<!-- gh-comment-id:4022087199 --> @adhusch commented on GitHub (Mar 9, 2026): Thank you! Something like "Generate a simple HTML page with button labelled click-me". Never tried with Mistral Large, but should be similar if it uses the same reasoning format. Are you referrig to Mistral Large 3? As Ministral 3 is affected i would expect the whole Mistral 3 model familiy. @motosir you had reported same issue with GLM 4.7. Is this fixed?
Author
Owner

@ShirasawaSama commented on GitHub (Mar 9, 2026):

I have a method that is 100% reproducible (on v0.8.10 and 03092026 dev).

Image

Reproduction Steps:

  1. Add pipeline: https://github.com/owndev/Open-WebUI-Functions/blob/main/pipelines/google/google_gemini.py
  2. Configure Google AI key in valves
  3. Enable code execution and web search for Google Gemini Pro 3 or 3.1 models in admin settings
  4. Ensure the tool invocation for the above models is set to default (as pipeline models currently do not support native tool invocation).
  5. Enable online search + code interpreter in the dialog box.
  6. Send the prompt “Write a Python algorithm for rainwater harvesting (You need to perform online searches, review existing algorithms, summarize them for me, output a Markdown code block in the thought chain, and execute the code)” to the above model and observe the response.

Markdown output

2cc8d9596c/gemini_3.1_example.md

<!-- gh-comment-id:4022335154 --> @ShirasawaSama commented on GitHub (Mar 9, 2026): ## I have a method that is 100% reproducible (on v0.8.10 and 03092026 dev). <img width="2048" height="1440" alt="Image" src="https://github.com/user-attachments/assets/c35fe788-6cca-475a-a2bd-7f87a988d105" /> ## Reproduction Steps: 1. Add pipeline: https://github.com/owndev/Open-WebUI-Functions/blob/main/pipelines/google/google_gemini.py 2. Configure Google AI key in valves 3. Enable code execution and web search for Google Gemini Pro 3 or 3.1 models in admin settings 4. Ensure the tool invocation for the above models is set to default (as pipeline models currently do not support native tool invocation). 5. Enable online search + code interpreter in the dialog box. 6. Send the prompt “Write a Python algorithm for rainwater harvesting (You need to perform online searches, review existing algorithms, summarize them for me, output a Markdown code block in the thought chain, and execute the code)” to the above model and observe the response. ## Markdown output https://gist.githubusercontent.com/sdp-ncd/0ed7bfa04a06805c907ebc331e5b08e5/raw/2cc8d9596cf36c691e33ec40622a40dcf0e1ef87/gemini_3.1_example.md
Author
Owner

@adhusch commented on GitHub (Mar 9, 2026):

@ShirasawaSama im not entirly sure if this is the same bug as discussed here? It could be a common root cause, but the behaviour seems different. Here, we so far referred specificially to the situation that an artifact is created, and in this case HTML code drafted in the thinking process of a model beeing displayed additionaly to the final code in front of the artifact, as in screenshot. This is 100% reproducible for any HTML output in all recent Mistral reasoning models i tested so far.
(See also the screenshots from different people and models in #20801)

Image
<!-- gh-comment-id:4023449820 --> @adhusch commented on GitHub (Mar 9, 2026): @ShirasawaSama im not entirly sure if this is the same bug as discussed here? It could be a common root cause, but the behaviour seems different. Here, we so far referred specificially to the situation that an artifact is created, and in this case HTML code drafted in the thinking process of a model beeing displayed additionaly to the final code in front of the artifact, as in screenshot. This is 100% reproducible for any HTML output in all recent Mistral reasoning models i tested so far. (See also the screenshots from different people and models in #20801) <img width="1072" height="338" alt="Image" src="https://github.com/user-attachments/assets/56b2c52a-ec40-44bc-bae6-cb0fd0d50b5d" />
Author
Owner

@tjbck commented on GitHub (Mar 25, 2026):

Unable to reproduce with the latest dev.

<!-- gh-comment-id:4122695213 --> @tjbck commented on GitHub (Mar 25, 2026): Unable to reproduce with the latest dev.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#58348