mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
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?
Originally created by @dennis-vanstrien on GitHub (Apr 25, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24138
Check Existing Issues
I have searched the existing issues and discussions.
I am using the latest version of Open WebUI.
Open WebUI Version
0.9.2 (latest as of April 2026)
Installation Method
Docker
Description
PR #15366 added
OAUTH_TIMEOUTto fixhttpx.ReadTimeoutfor OIDC SSO login flows. However, the fix was not applied to the MCP tool server OAuth 2.1 path. Theadd_client()function inoauth.py(used for MCP tool connections) still has a hardcoded default httpx timeout with no env var override.Expected Behavior
OAUTH_TIMEOUTshould control the timeout for all OAuth flows, including MCP tool server OAuth 2.1 token exchanges.Actual Behavior
When connecting an MCP tool server that uses OAuth 2.1 (e.g. Lucid:
https://mcp.lucid.app/mcp), the token endpoint athttps://mcp.lucid.app/oauth/tokentakes ~5.71 seconds to respond. The default httpx timeout of 5 seconds causes the callback to fail:Setting
OAUTH_TIMEOUT=60in the environment has no effect on the MCP path — confirmed by inspecting the source:OAUTH_TIMEOUThas 0 references inadd_client()in v0.9.2.Root Cause
In
backend/open_webui/utils/oauth.py, theadd_client()method buildsclient_kwargswithout readingOAUTH_TIMEOUT:Workaround
Manually adding
'timeout': 60.0toclient_kwargsinadd_client()resolves the issue.Suggested Fix
Apply
OAUTH_TIMEOUTto theclient_kwargsinadd_client(), consistent with how #15366 fixed the OIDC path:Steps to Reproduce
https://mcp.lucid.app/mcp)httpx.ReadTimeoutwhen POSTing to the token endpointAdditional Information
add_client()path in the same file)httpxtestOAUTH_TIMEOUT=60env var has 0 references inadd_client()— it has no effect on the MCP OAuth path