ITADN

[Bug]: WebSocket passthrough is never registered for the OpenAI prefixes — client.responses.connect() cannot work

#36088Opensudhanshugupta-p72 创建于 14 天前
bugproxyllm translation
### Check for existing issues - [x] I have searched the existing issues and checked that my issue is not a duplicate. ### What happened? `create_websocket_passthrough_route` exists and is imported into the passthrough endpoints module, but it is never registered for `/openai/*` or `/openai_passthrough/*`. The OpenAI passthrough route is declared for HTTP verbs only, so a WebSocket upgrade is rejected at routing — before auth or any isolation logic runs. This makes WebSocket-based OpenAI features (e.g. `client.responses.connect()`, realtime) unreachable through the passthrough route. ### Steps to Reproduce WebSocket upgrade attempt: ``` GET (WS upgrade) /openai_passthrough/v1/realtime -> 403 HTTP/1.1 403 Forbidden GET (WS upgrade) /openai/v1/realtime -> 403 HTTP/1.1 403 Forbidden GET (WS upgrade) /openai_passthrough/v1/responses -> 403 HTTP/1.1 403 Forbidden ``` The 403 is a routing-level rejection, not an authorization decision — it occurs identically regardless of key validity or isolation configuration. ## Where `litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py` - `:42` — `create_websocket_passthrough_route` imported - `:1876-1885` — the OpenAI passthrough route registers `methods=["GET", "POST", "PUT", "DELETE", "PATCH"]` for both `/openai_passthrough/{endpoint:path}` and `/openai/{endpoint:path}` - `:2281` — the only reference to the helper, inside `create_anthropic_websocket_endpoint`, which is itself documented as an example: ``` # Register it in proxy_server.py app.websocket("/anthropic/ws")(anthropic_ws_func) ``` So the helper appears to be the intended mechanism; it simply is not wired to the OpenAI prefixes. ## Expected Either a WebSocket route registered for the OpenAI passthrough prefixes, or documentation stating that WebSocket passthrough is unsupported for OpenAI so callers do not expect `client.responses.connect()` to work. ### Relevant log output ```shell ``` ### What part of LiteLLM is this about? Proxy ### What LiteLLM version are you on ? v1.89.0 ### Twitter / LinkedIn details _No response_
0 条评论