Broken code snippets in response from o1 and o3-mini #3776

Closed
opened 2025-11-11 15:39:35 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @LucaCraft89 on GitHub (Feb 12, 2025).

Bug Report

Installation Method

Docker Compose

Environment

  • Open WebUI Version: v0.5.10

  • Ollama (if applicable): 0.5.4 but Not using

  • Operating System: Windows 11

  • Browser (if applicable): Microsoft Edge Version 132.0.2957.140

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on 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 the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Expected Behavior:

Correctly formatted code snippets in o1 and o3-mini models

Actual Behavior:

Code snippets do not appear formatted at all

Description

Bug Summary:
When o1 or o3-mini put code snippets in response openwebui appears not to be inerpreting them as it should

Reproduction Details

Steps to Reproduce:

  1. Select o1 or o3-mini model from OpenAI
  2. Ask it to write any piece of code
  3. Observe unformatted code snippets

Logs and Screenshots

Browser Console Logs:
Not related

Docker Container Logs:
Not related

Screenshots/Screen Recordings (if applicable):
Image

Additional Information

i belive that the model is not responding like this

{Repsonse}

but responding like this

{Response}

note without the code delimiters

Note

If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!

Originally created by @LucaCraft89 on GitHub (Feb 12, 2025). # Bug Report ## Installation Method Docker Compose ## Environment - **Open WebUI Version:** v0.5.10 - **Ollama (if applicable):** 0.5.4 but Not using - **Operating System:** Windows 11 - **Browser (if applicable):** Microsoft Edge Version 132.0.2957.140 **Confirmation:** - [X] I have read and followed all the instructions provided in the README.md. - [X] I am on the latest version of both Open WebUI and Ollama. - [ ] I have included the browser console logs. - [ ] I have included the Docker container logs. - [X] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. ## Expected Behavior: Correctly formatted code snippets in o1 and o3-mini models ## Actual Behavior: Code snippets do not appear formatted at all ## Description **Bug Summary:** When o1 or o3-mini put code snippets in response openwebui appears not to be inerpreting them as it should ## Reproduction Details **Steps to Reproduce:** 1. Select o1 or o3-mini model from OpenAI 2. Ask it to write any piece of code 3. Observe unformatted code snippets ## Logs and Screenshots **Browser Console Logs:** Not related **Docker Container Logs:** Not related **Screenshots/Screen Recordings (if applicable):** ![Image](https://github.com/user-attachments/assets/ea70da2b-c7a5-450b-b403-96776aea9738) ## Additional Information i belive that the model is not responding like this ```format {Repsonse} ``` but responding like this {Response} note without the code delimiters ## Note If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
Author
Owner

@unfailingsalvage1448 commented on GitHub (Feb 12, 2025):

I think it is related to this issue on the OpenAI forums:

Quoting this passge:

Markdown formatting: Starting with o1-2024-12-17, reasoning models in the API will avoid generating responses with markdown formatting. To signal to the model when you do want markdown formatting in the response, include the string Formatting re-enabled on the first line of your developer message.

@unfailingsalvage1448 commented on GitHub (Feb 12, 2025): I think it is related to [this issue](https://community.openai.com/t/o1-api-doesnt-separate-code-blocks-with-three-backticks/1099469) on the OpenAI forums: Quoting [this passge](https://platform.openai.com/docs/guides/reasoning?reasoning-prompt-examples=coding-planning#advice-on-prompting): > Markdown formatting: Starting with o1-2024-12-17, reasoning models in the API will avoid generating responses with markdown formatting. To signal to the model when you do want markdown formatting in the response, include the string Formatting re-enabled on the first line of your developer message.
Author
Owner

@LucaCraft89 commented on GitHub (Feb 13, 2025):

how can i anable marksown responses by default in openwebui?

@LucaCraft89 commented on GitHub (Feb 13, 2025): how can i anable marksown responses by default in openwebui?
Author
Owner

@LucaCraft89 commented on GitHub (Feb 13, 2025):

Image

never mind i fixed it by adding
If code is in the response use markdown
in the system prompt field

@LucaCraft89 commented on GitHub (Feb 13, 2025): ![Image](https://github.com/user-attachments/assets/1e8f7041-8322-4300-8c16-b8da0550d461) never mind i fixed it by adding ` If code is in the response use markdown ` in the system prompt field
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#3776