[GH-ISSUE #24195] v0.9.2: MCP tool results wrapped in RAG citation template and displayed as raw <source> blocks #107220

Open
opened 2026-05-18 05:55:02 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @Jaypeg-dev on GitHub (Apr 28, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24195

Bug Report

Version

Open WebUI v0.9.2

Description

After upgrading from v0.9.1 to v0.9.2, MCP tool call results are being wrapped in a RAG citation template and displayed visibly in the chat as raw <source> blocks, instead of being processed silently and used by the model to compose a natural response.

The chat displays a block like:

### Task: Respond to the user query...
<source>
... raw MCP tool result JSON ...
</source>

This appears to be a side effect of the MCP asyncio cancellation fix introduced in v0.9.2.

Steps to Reproduce

  1. Register any MCP server in Admin Panel → Settings → Integrations
  2. Assign it to a model via toolIds in the model config
  3. Start a conversation and trigger a tool call (e.g. ask the model to read a file or fetch data)
  4. Observe: tool result is rendered as a visible ### Task: Respond to the user query... + <source> block in the chat

Expected Behaviour

MCP tool results are processed silently in the background. The model uses the tool result data to compose a natural language response, with no raw JSON or citation blocks visible to the user.

Actual Behaviour

The full RAG citation template is rendered visibly in the chat, including raw <source> XML blocks containing the tool result JSON. This makes MCP-enabled agents unusable as the chat is flooded with raw tool output.

Environment

  • Open WebUI: v0.9.2
  • MCP servers: FastMCP 3.x (Python), transport=streamable-http, stateless_http=True
  • Deployment: Docker container (colima VM on Mac Mini M4)
  • Models tested: claude-sonnet-4-6, claude-haiku-4-5, llama3.1:8b (all affected)

Workaround Attempted

Setting RAG_TEMPLATE env var to empty string does not persist — PersistentConfig reverts to the default template on every container restart, so this cannot be patched via environment variable.

Additional Context

This regression was not present in v0.9.1 (though v0.9.1 had the separate CPU/spinning conversation bug that v0.9.2 fixed). The MCP asyncio cancellation fix in v0.9.2 appears to have changed how tool results are routed through the response pipeline, causing them to pass through the RAG citation renderer instead of the tool result handler.

All MCP tool calls fire correctly and return valid data — the issue is purely in how the results are presented in the UI.

Originally created by @Jaypeg-dev on GitHub (Apr 28, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/24195 ## Bug Report ### Version Open WebUI v0.9.2 ### Description After upgrading from v0.9.1 to v0.9.2, MCP tool call results are being wrapped in a RAG citation template and displayed visibly in the chat as raw `<source>` blocks, instead of being processed silently and used by the model to compose a natural response. The chat displays a block like: ``` ### Task: Respond to the user query... <source> ... raw MCP tool result JSON ... </source> ``` This appears to be a side effect of the MCP asyncio cancellation fix introduced in v0.9.2. ### Steps to Reproduce 1. Register any MCP server in Admin Panel → Settings → Integrations 2. Assign it to a model via `toolIds` in the model config 3. Start a conversation and trigger a tool call (e.g. ask the model to read a file or fetch data) 4. Observe: tool result is rendered as a visible `### Task: Respond to the user query...` + `<source>` block in the chat ### Expected Behaviour MCP tool results are processed silently in the background. The model uses the tool result data to compose a natural language response, with no raw JSON or citation blocks visible to the user. ### Actual Behaviour The full RAG citation template is rendered visibly in the chat, including raw `<source>` XML blocks containing the tool result JSON. This makes MCP-enabled agents unusable as the chat is flooded with raw tool output. ### Environment - Open WebUI: v0.9.2 - MCP servers: FastMCP 3.x (Python), transport=`streamable-http`, `stateless_http=True` - Deployment: Docker container (colima VM on Mac Mini M4) - Models tested: claude-sonnet-4-6, claude-haiku-4-5, llama3.1:8b (all affected) ### Workaround Attempted Setting `RAG_TEMPLATE` env var to empty string does not persist — `PersistentConfig` reverts to the default template on every container restart, so this cannot be patched via environment variable. ### Additional Context This regression was not present in v0.9.1 (though v0.9.1 had the separate CPU/spinning conversation bug that v0.9.2 fixed). The MCP asyncio cancellation fix in v0.9.2 appears to have changed how tool results are routed through the response pipeline, causing them to pass through the RAG citation renderer instead of the tool result handler. All MCP tool calls fire correctly and return valid data — the issue is purely in how the results are presented in the UI.
Author
Owner

@gorkemozlu commented on GitHub (Apr 29, 2026):

Actually, we found it very useful for debugging, even though it is a regression, maybe we can keep that behaviour under a debug parameter ?

<!-- gh-comment-id:4341252055 --> @gorkemozlu commented on GitHub (Apr 29, 2026): Actually, we found it very useful for debugging, even though it is a regression, maybe we can keep that behaviour under a debug parameter ?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#107220