[GH-ISSUE #16745] issue: Copy button in code blocks copies the original AI output instead of the edited content #56696

Closed
opened 2026-05-05 19:56:22 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @yuliang615 on GitHub (Aug 20, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/16745

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

0.6.22 dev

Ollama Version (if applicable)

No response

Operating System

macos

Browser (if applicable)

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

The "copy" button should copy the currently visible / edited content from the code block, not only the original AI output.

Actual Behavior

The button ignores user modifications and always returns the original AI output.

Steps to Reproduce

Ask the AI to generate a code block.
Manually edit the code inside the displayed code block within the UI.
Try copying the edited content using:
Option A: Select text with the mouse and copy or use ctrl+c command+c → Copies the edited content.
Option B: Click the "copy" button at the top-right corner of the code block → Copies only the original AI output.

Logs & Screenshots

Image Option A will copy print("Hello, Worl but Option B will copy print("Hello, World!")

Additional Information

No response

Originally created by @yuliang615 on GitHub (Aug 20, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/16745 ### 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 0.6.22 dev ### Ollama Version (if applicable) _No response_ ### Operating System macos ### Browser (if applicable) 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 The "copy" button should copy the currently visible / edited content from the code block, not only the original AI output. ### Actual Behavior The button ignores user modifications and always returns the original AI output. ### Steps to Reproduce Ask the AI to generate a code block. Manually edit the code inside the displayed code block within the UI. Try copying the edited content using: Option A: Select text with the mouse and copy or use ctrl+c command+c → Copies the edited content. Option B: Click the "copy" button at the top-right corner of the code block → Copies only the original AI output. ### Logs & Screenshots <img width="930" height="55" alt="Image" src="https://github.com/user-attachments/assets/32383a36-3757-40a9-abe1-ca0d504b76b1" /> Option A will copy print("Hello, Worl but Option B will copy print("Hello, World!") ### Additional Information _No response_
GiteaMirror added the bug label 2026-05-05 19:56:22 -05:00
Author
Owner

@yuliang615 commented on GitHub (Aug 23, 2025):

Fix in https://github.com/open-webui/open-webui/pull/16853

<!-- gh-comment-id:3217002808 --> @yuliang615 commented on GitHub (Aug 23, 2025): Fix in https://github.com/open-webui/open-webui/pull/16853
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#56696