[GH-ISSUE #24947] issue: System Prompt is thrown out during RAG when Open Terminal is connected #123748

Open
opened 2026-05-21 03:14:22 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @seamon67 on GitHub (May 20, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24947

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.9.5

Ollama Version (if applicable)

No response

Operating System

Linux

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

System Prompt defined in the Model's System Prompt should be present in all Requests.

Actual Behavior

Model's System Prompt is thrown out when RAG is triggered and Open Terminal is connected.
This happens during interleaved thinking and function calling.

In the first request, the System Prompt is sent correctly as

{{SYSTEM_PROMPT}}
{{OPEN_TERMINAL_PROMPT}}

In every subsequent request where RAG is triggered, the System Prompt is thrown out. The request looks like

{{OPEN_TERMINAL_PROMPT}}

This happens under very specific conditions:

  1. Open Terminal is connected.
  2. RAG is triggered.

Steps to Reproduce

  1. Make Sure Open Terminal is connected (tested with Open Terminal v0.11.34).
  2. Make sure Web Search is configured (to trigger RAG).
  3. Start a Chat with Open Terminal connected and ask the LLM to search for something.
  4. In the first request to the LLM, the correct System Prompt will be sent which looks like
{{SYSTEM_PROMPT}}
{{OPEN_TERMINAL_PROMPT}}
  1. When RAG is triggered due to web search, the System Prompt in the request will look like
{{OPEN_TERMINAL_PROMPT}}

Logs & Screenshots

Not necessary

Additional Information

If Open Terminal is disconnected the System Prompt in the request to the LLM is always correct as

{{SYSTEM_PROMPT}}
Originally created by @seamon67 on GitHub (May 20, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/24947 ### 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.9.5 ### Ollama Version (if applicable) _No response_ ### Operating System Linux ### 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 System Prompt defined in the Model's System Prompt should be present in all Requests. ### Actual Behavior Model's System Prompt is thrown out when RAG is triggered and Open Terminal is connected. This happens during interleaved thinking and function calling. In the first request, the System Prompt is sent correctly as ``` {{SYSTEM_PROMPT}} {{OPEN_TERMINAL_PROMPT}} ``` In every subsequent request where RAG is triggered, the System Prompt is thrown out. The request looks like ``` {{OPEN_TERMINAL_PROMPT}} ``` This happens under very specific conditions: 1. Open Terminal is connected. 2. RAG is triggered. ### Steps to Reproduce 1. Make Sure Open Terminal is connected (tested with Open Terminal v0.11.34). 2. Make sure Web Search is configured (to trigger RAG). 3. Start a Chat with Open Terminal connected and ask the LLM to search for something. 4. In the first request to the LLM, the correct System Prompt will be sent which looks like ``` {{SYSTEM_PROMPT}} {{OPEN_TERMINAL_PROMPT}} ``` 5. When RAG is triggered due to web search, the System Prompt in the request will look like ``` {{OPEN_TERMINAL_PROMPT}} ``` ### Logs & Screenshots Not necessary ### Additional Information If Open Terminal is disconnected the System Prompt in the request to the LLM is always correct as ``` {{SYSTEM_PROMPT}} ```
GiteaMirror added the bug label 2026-05-21 03:14:22 -05:00
Author
Owner

@owui-terminator[bot] commented on GitHub (May 20, 2026):

🔍 Related Issues Found

I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:

  1. 🟣 #22965 issue: Code interpreter prompt (Pyodide) injected into user turn instead of system prompt
    This is the closest match: it reports another special prompt being appended to the user turn instead of the system prompt. Your issue appears to be the same class of bug, but triggered when Open Terminal is connected and RAG/tool-calling reruns the prompt assembly.
    by AirRunner · bug

  2. 🟣 #19098 issue: Prompt & context duplication when RAG template is used
    This issue describes RAG prompt/context duplication when tool or source context is injected, which is directly related to the RAG-side prompt handling in your report. It may share the same source-context injection path that causes the system prompt to be lost or replaced.
    by matiboux · bug

  3. 🟣 #21663 issue: RAG template mutates web search tool call args
    This bug is specifically about RAG/source templating interacting badly with web search tool calls. Since your reproduction requires web search/RAG and occurs during function calling, it is likely related to the same middleware path.
    by relic664 · bug

  4. 🟣 #24193 Issue #24193
    This is a broader system-prompt regression. While not specific to Open Terminal, it is relevant because your report is fundamentally about the system prompt disappearing in certain request-building paths.
    by unknown


💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.

This comment was generated automatically. React with 👍 if helpful, 👎 if not.

<!-- gh-comment-id:4498520918 --> @owui-terminator[bot] commented on GitHub (May 20, 2026): <!-- terminator-bot:related-issues-reply --> 🔍 **Related Issues Found** I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions: 1. 🟣 [#22965](https://github.com/open-webui/open-webui/issues/22965) **issue: Code interpreter prompt (Pyodide) injected into user turn instead of system prompt** *This is the closest match: it reports another special prompt being appended to the user turn instead of the system prompt. Your issue appears to be the same class of bug, but triggered when Open Terminal is connected and RAG/tool-calling reruns the prompt assembly.* *by AirRunner · `bug`* 2. 🟣 [#19098](https://github.com/open-webui/open-webui/issues/19098) **issue: Prompt & context duplication when RAG template is used** *This issue describes RAG prompt/context duplication when tool or source context is injected, which is directly related to the RAG-side prompt handling in your report. It may share the same source-context injection path that causes the system prompt to be lost or replaced.* *by matiboux · `bug`* 3. 🟣 [#21663](https://github.com/open-webui/open-webui/issues/21663) **issue: RAG template mutates web search tool call args** *This bug is specifically about RAG/source templating interacting badly with web search tool calls. Since your reproduction requires web search/RAG and occurs during function calling, it is likely related to the same middleware path.* *by relic664 · `bug`* 4. 🟣 [#24193](https://github.com/open-webui/open-webui/issues/24193) **Issue #24193** *This is a broader system-prompt regression. While not specific to Open Terminal, it is relevant because your report is fundamentally about the system prompt disappearing in certain request-building paths.* *by unknown* --- 💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead. *This comment was generated automatically.* React with 👍 if helpful, 👎 if not.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#123748