From 288bf91f73b9b1bc0c1a6b9d2700b108e50742df Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 30 Sep 2026 17:24:03 +0200 Subject: [PATCH] fix: tool prompts time out when the user's tab is on another instance (#31620) With WEBSOCKET_MANAGER=redis and several instances or workers, an instance only subscribed to Redis once a browser tab had connected to it. Until then, when a tool or Function asked the user something (a confirmation or an input dialog) and the user's tab was connected to another instance, the user's reply never reached the tool and it waited until it timed out. Every instance now subscribes at startup, so the reply arrives whichever instance the tab is on. --- backend/open_webui/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index da2eea353d..ab9387e47f 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -193,6 +193,7 @@ from open_webui.socket.main import ( periodic_session_pool_cleanup, periodic_usage_pool_cleanup, redis_event_listener, + sio, ) from open_webui.socket.main import ( app as socket_app, @@ -398,6 +399,9 @@ async def lifespan(app: FastAPI): if WEBSOCKET_MANAGER == 'redis': app.state.redis_event_listener = asyncio.create_task(redis_event_listener()) + # socket.io only starts listening on its first connect; event call answers need it earlier + sio.manager_initialized = True + sio.manager.initialize() app.state.periodic_usage_pool_cleanup = asyncio.create_task(periodic_usage_pool_cleanup()) app.state.periodic_session_pool_cleanup = asyncio.create_task(periodic_session_pool_cleanup())