Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
Target branch: Please verify that the pull request targets the dev branch.
Description: Provide a concise description of the changes made in this pull request.
Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
Testing: Have you written and run sufficient tests to validate the changes?
Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
BREAKING CHANGE: Significant changes that may affect compatibility
build: Changes that affect the build system or external dependencies
ci: Changes to our continuous integration processes or workflows
chore: Refactor, cleanup, or other non-functional code changes
docs: Documentation update or addition
feat: Introduces a new feature or enhancement to the codebase
fix: Bug fix or error correction ✓
i18n: Internationalization or localization changes
perf: Performance improvement
refactor: Code restructuring for better maintainability, readability, or scalability
style: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.)
test: Adding missing tests or correcting existing tests
WIP: Work in progress, a temporary label for incomplete or ongoing work
Changelog Entry
Description
Fixed hardcoded Redis key prefixes in tasks and socket modules to properly respect the REDIS_KEY_PREFIX environment variable, ensuring consistent key namespacing for Redis cluster-mode compatibility
Added
N/A
Changed
Updated backend/open_webui/tasks.py to use REDIS_KEY_PREFIX environment variable instead of hardcoded "open-webui" prefix
Updated backend/open_webui/socket/main.py to use REDIS_KEY_PREFIX environment variable for session pool, user pool, usage pool, and YdocManager keys
Updated backend/open_webui/socket/utils.py YdocManager class default parameter to use REDIS_KEY_PREFIX environment variable
Deprecated
N/A
Removed
N/A
Fixed
Fixed hardcoded Redis key prefixes that were not respecting the REDIS_KEY_PREFIX environment variable
Resolved Redis cluster-mode compatibility issues by ensuring all Redis keys use the configurable prefix
Fixed inconsistent key namespacing between different modules
Security
N/A
Breaking Changes
N/A
Additional Information
This fix ensures that all Redis operations in the tasks and socket modules now properly respect the REDIS_KEY_PREFIX environment variable
The changes maintain backward compatibility as the default value remains "open-webui"
This allows multiple Open WebUI instances to share a Redis cluster with isolated key namespaces
Files modified:
backend/open_webui/tasks.py: Updated Redis key constants to use environment variable
backend/open_webui/socket/main.py: Updated RedisDict and YdocManager instantiations to use environment variable
backend/open_webui/socket/utils.py: Updated YdocManager class constructor default parameter
Screenshots or Videos
N/A
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/15941
**Author:** [@taylorwilsdon](https://github.com/taylorwilsdon)
**Created:** 7/22/2025
**Status:** ✅ Merged
**Merged:** 7/23/2025
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `tasks_redis_key_prefix`
---
### 📝 Commits (2)
- [`3e686e9`](https://github.com/open-webui/open-webui/commit/3e686e9915f5d42cc9de4976eb1a6b35d6f54012) implement redis_key_prefix env support in all areas invoking redis to allow for clustermode compatibility with new docs function
- [`65654a3`](https://github.com/open-webui/open-webui/commit/65654a3b4c6678600b07cf4be8e2465f8d561b4b) fix last key prefix
### 📊 Changes
**3 files changed** (+11 additions, -9 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/socket/main.py` (+5 -4)
📝 `backend/open_webui/socket/utils.py` (+2 -1)
📝 `backend/open_webui/tasks.py` (+4 -4)
</details>
### 📄 Description
Ref: https://github.com/open-webui/open-webui/discussions/15834
# Pull Request Checklist
### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request.
**Before submitting, make sure you've checked the following:**
- [x] **Target branch:** Please verify that the pull request targets the `dev` branch.
- [x] **Description:** Provide a concise description of the changes made in this pull request.
- [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description.
- [x] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources?
- [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation?
- [x] **Testing:** Have you written and run sufficient tests to validate the changes?
- [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
- [x] **Prefix:** To clearly categorize this pull request, prefix the pull request title using one of the following:
- **BREAKING CHANGE**: Significant changes that may affect compatibility
- **build**: Changes that affect the build system or external dependencies
- **ci**: Changes to our continuous integration processes or workflows
- **chore**: Refactor, cleanup, or other non-functional code changes
- **docs**: Documentation update or addition
- **feat**: Introduces a new feature or enhancement to the codebase
- **fix**: Bug fix or error correction ✓
- **i18n**: Internationalization or localization changes
- **perf**: Performance improvement
- **refactor**: Code restructuring for better maintainability, readability, or scalability
- **style**: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.)
- **test**: Adding missing tests or correcting existing tests
- **WIP**: Work in progress, a temporary label for incomplete or ongoing work
# Changelog Entry
### Description
- Fixed hardcoded Redis key prefixes in tasks and socket modules to properly respect the REDIS_KEY_PREFIX environment variable, ensuring consistent key namespacing for Redis cluster-mode compatibility
### Added
- N/A
### Changed
- Updated `backend/open_webui/tasks.py` to use `REDIS_KEY_PREFIX` environment variable instead of hardcoded "open-webui" prefix
- Updated `backend/open_webui/socket/main.py` to use `REDIS_KEY_PREFIX` environment variable for session pool, user pool, usage pool, and YdocManager keys
- Updated `backend/open_webui/socket/utils.py` YdocManager class default parameter to use `REDIS_KEY_PREFIX` environment variable
### Deprecated
- N/A
### Removed
- N/A
### Fixed
- Fixed hardcoded Redis key prefixes that were not respecting the REDIS_KEY_PREFIX environment variable
- Resolved Redis cluster-mode compatibility issues by ensuring all Redis keys use the configurable prefix
- Fixed inconsistent key namespacing between different modules
### Security
- N/A
### Breaking Changes
- N/A
---
### Additional Information
- This fix ensures that all Redis operations in the tasks and socket modules now properly respect the `REDIS_KEY_PREFIX` environment variable
- The changes maintain backward compatibility as the default value remains "open-webui"
- This allows multiple Open WebUI instances to share a Redis cluster with isolated key namespaces
- Files modified:
- `backend/open_webui/tasks.py`: Updated Redis key constants to use environment variable
- `backend/open_webui/socket/main.py`: Updated RedisDict and YdocManager instantiations to use environment variable
- `backend/open_webui/socket/utils.py`: Updated YdocManager class constructor default parameter
### Screenshots or Videos
- N/A
### Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/15941
Author: @taylorwilsdon
Created: 7/22/2025
Status: ✅ Merged
Merged: 7/23/2025
Merged by: @tjbck
Base:
dev← Head:tasks_redis_key_prefix📝 Commits (2)
3e686e9implement redis_key_prefix env support in all areas invoking redis to allow for clustermode compatibility with new docs function65654a3fix last key prefix📊 Changes
3 files changed (+11 additions, -9 deletions)
View changed files
📝
backend/open_webui/socket/main.py(+5 -4)📝
backend/open_webui/socket/utils.py(+2 -1)📝
backend/open_webui/tasks.py(+4 -4)📄 Description
Ref: https://github.com/open-webui/open-webui/discussions/15834
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Added
Changed
backend/open_webui/tasks.pyto useREDIS_KEY_PREFIXenvironment variable instead of hardcoded "open-webui" prefixbackend/open_webui/socket/main.pyto useREDIS_KEY_PREFIXenvironment variable for session pool, user pool, usage pool, and YdocManager keysbackend/open_webui/socket/utils.pyYdocManager class default parameter to useREDIS_KEY_PREFIXenvironment variableDeprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
REDIS_KEY_PREFIXenvironment variablebackend/open_webui/tasks.py: Updated Redis key constants to use environment variablebackend/open_webui/socket/main.py: Updated RedisDict and YdocManager instantiations to use environment variablebackend/open_webui/socket/utils.py: Updated YdocManager class constructor default parameterScreenshots or Videos
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.