mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[PR #23752] [CLOSED] perf(mcp): pool bearer-auth connections and emit progress status events #27354
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23752
Author: @DSavaliya-gh
Created: 4/15/2026
Status: ❌ Closed
Base:
dev← Head:fix/mcp-connection-pool-status-events📝 Commits (1)
9a466c2perf(mcp): pool bearer-auth connections and emit status events📊 Changes
1 file changed (+54 additions, -5 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+54 -5)📄 Description
Summary
Fixes #23751 — MCP tool servers reconnect from scratch on every chat message with zero user feedback, causing a 15–20 second silent blinking-dot phase before the model starts.
What Changed
One file modified:
backend/open_webui/utils/middleware.pyBefore
No status event. User sees blinking dot for 15-20 s with zero feedback.
After
1 — Progress status events
The existing
StatusHistorycomponent renders these immediately — same UX as web search status.2 — Connection pool for static bearer-auth servers
Per-user auth types (
session,oauth_2.1) are never pooled — they always get a fresh connection to preserve per-user token isolation. Stale pool entries are evicted on any connection error.Pull Request Checklist
devStatusHistory; warm connections skip the handshakeapp.statepattern (same asTOOL_SERVERS); no new settings addeddevChangelog Entry
Description
Fixed a 15–20 second silent "blinking dot" delay that appeared before every chat message when MCP tool servers were configured. The fix adds visible progress status events and introduces a connection pool for bearer-auth MCP servers so the full TCP/HTTP/MCP handshake is not repeated on every message.
Fixed
Changed
type: 'status'events (action: 'mcp_connect') so the user sees activity in theStatusHistorycomponent during any connection waitAdditional Information
mcp_client_poolkey onapp.statefollows the same pattern asapp.state.TOOL_SERVERSused inutils/tools.pyBy submitting this pull request, I confirm that my contribution is made under the terms of the MIT license, and I agree to the Contributor License Agreement.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.