Code blocks disappear after chat completion #2736

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

Originally created by @Fishforgithub on GitHub (Nov 21, 2024).

Code blocks disappear after chat completion

Issue Description

When using Open WebUI with CodeLlama, the code blocks in the chat interface are not displaying properly. While the AI is responding, the code blocks are visible and properly formatted. However, after the response is complete, all code blocks are replaced with text saying "代碼區塊" (Code Block).

Steps to Reproduce

  1. Start a new chat with CodeLlama in Open WebUI
  2. Ask the AI to write any Python code
  3. During the response, the code blocks are properly displayed with syntax highlighting
  4. After the response is complete, all code blocks disappear and are replaced with "代碼區塊"

Expected Behavior

  • Code blocks should remain visible after the AI completes its response
  • Syntax highlighting should be maintained
  • The formatting should be consistent before and after response completion

Current Behavior

  • Code blocks are visible during AI response
  • After response completion, code blocks are replaced with text "代碼區塊"
  • The actual code content becomes inaccessible

Environment

  • Open WebUI Version: v0.4.1
  • Browser: Chrome 131.0.6778.71
  • OS: win 11
  • Model: codellama:latest

Additional Information

  • This issue affects all code blocks in the conversation
  • The problem is consistent across different chat sessions
  • Markdown formatting for other elements (like lists and headers) remains intact

Screenshots

image
image

  • Is this related to Markdown rendering?
  • Could it be a CSS/JavaScript issue?
  • Is it related to the chat completion event handler?
Originally created by @Fishforgithub on GitHub (Nov 21, 2024). # Code blocks disappear after chat completion ## Issue Description When using Open WebUI with CodeLlama, the code blocks in the chat interface are not displaying properly. While the AI is responding, the code blocks are visible and properly formatted. However, after the response is complete, all code blocks are replaced with text saying "代碼區塊" (Code Block). ## Steps to Reproduce 1. Start a new chat with CodeLlama in Open WebUI 2. Ask the AI to write any Python code 3. During the response, the code blocks are properly displayed with syntax highlighting 4. After the response is complete, all code blocks disappear and are replaced with "代碼區塊" ## Expected Behavior - Code blocks should remain visible after the AI completes its response - Syntax highlighting should be maintained - The formatting should be consistent before and after response completion ## Current Behavior - Code blocks are visible during AI response - After response completion, code blocks are replaced with text "代碼區塊" - The actual code content becomes inaccessible ## Environment - Open WebUI Version: v0.4.1 - Browser: Chrome 131.0.6778.71 - OS: win 11 - Model: codellama:latest ## Additional Information - This issue affects all code blocks in the conversation - The problem is consistent across different chat sessions - Markdown formatting for other elements (like lists and headers) remains intact ## Screenshots ![image](https://github.com/user-attachments/assets/1430c7f8-9440-4caa-96a8-a8cf1d992e08) ![image](https://github.com/user-attachments/assets/266283c7-3f96-4132-9a02-799e47ef57f9) ## Possible Related Issues - Is this related to Markdown rendering? - Could it be a CSS/JavaScript issue? - Is it related to the chat completion event handler?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#2736