From 861953fd2d48f73f9187b58afa0164e9ad3aad75 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 7 Oct 2025 10:52:34 -0500 Subject: [PATCH] refac/fix: ENABLE_STAR_SESSIONS_MIDDLEWARE --- backend/open_webui/env.py | 5 +++++ backend/open_webui/main.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/env.py b/backend/open_webui/env.py index f7d9f9ccf7..8f9c1fbc44 100644 --- a/backend/open_webui/env.py +++ b/backend/open_webui/env.py @@ -212,6 +212,11 @@ ENABLE_FORWARD_USER_INFO_HEADERS = ( os.environ.get("ENABLE_FORWARD_USER_INFO_HEADERS", "False").lower() == "true" ) +# Experimental feature, may be removed in future +ENABLE_STAR_SESSIONS_MIDDLEWARE = ( + os.environ.get("ENABLE_STAR_SESSIONS_MIDDLEWARE", "False").lower() == "true" +) + #################################### # WEBUI_BUILD_HASH #################################### diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index d8893ce805..221c20f305 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -450,6 +450,7 @@ from open_webui.env import ( ENABLE_OTEL, EXTERNAL_PWA_MANIFEST_URL, AIOHTTP_CLIENT_SESSION_SSL, + ENABLE_STAR_SESSIONS_MIDDLEWARE, ) @@ -1946,7 +1947,7 @@ if len(app.state.config.TOOL_SERVER_CONNECTIONS) > 0: pass try: - if REDIS_URL: + if ENABLE_STAR_SESSIONS_MIDDLEWARE: redis_session_store = RedisStore( url=REDIS_URL, prefix=(f"{REDIS_KEY_PREFIX}:session:" if REDIS_KEY_PREFIX else "session:"),