When using Redis Cluster, stopping a task via POST /api/tasks/stop/{task_id}
results in AttributeError: 'RedisCluster' object has no attribute 'publish'
Root Cause
The redis_send_command() function directly calls redis.publish(), but:
Standard Redis has a publish() method
RedisCluster does NOT have a publish() method that broadcasts to all nodes
In Redis Cluster architecture, PUBLISH commands are node-local
Changes
Modified backend/open_webui/tasks.py
Added RedisCluster class import from redis.cluster
Updated redis_send_command() to handle both:
RedisCluster: Iterates through all master nodes and publishes to each
Standard Redis: Uses publish() normally
Test
The fix ensures task stop commands reach all worker nodes:
For RedisCluster: publishes to every master node (cluster-wide broadcast)
For standard Redis: publishes normally (single node)
Checklist
Minimal fix focused on the issue
No new dependencies added (using existing redis package)
Backward compatible (standard Redis still works)
Handles cluster architecture correctly (broadcast to all masters)
🔄 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/20746
**Author:** [@YuriNachos](https://github.com/YuriNachos)
**Created:** 1/17/2026
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `fix-rediscluster-publish`
---
### 📝 Commits (6)
- [`f84aad5`](https://github.com/open-webui/open-webui/commit/f84aad5f141ab769d4b75628f576c89c9ff88db9) fix: handle None value for model capabilities in builtin_tools check
- [`0d4898f`](https://github.com/open-webui/open-webui/commit/0d4898fa40798e396c4deb2f9cc71b0b7d54baf4) fix: handle None value for model capabilities in file_context check
- [`9772be0`](https://github.com/open-webui/open-webui/commit/9772be02cc1d4b4153a76fd15a12d07d47f8eb66) fix: handle None value for capabilities in get_model_capability helper
- [`3d404ff`](https://github.com/open-webui/open-webui/commit/3d404ff87cac3d257c56ed1ef198ed5b8c142ecf) fix: URL-encode OAuth client secrets to handle special characters
- [`3079444`](https://github.com/open-webui/open-webui/commit/3079444ab2f03123a9a7a4e0dc0e7fe135ea7452) fix: Decode HTML entities in tool call results before sending to LLM
- [`c1ec294`](https://github.com/open-webui/open-webui/commit/c1ec294a0392513b7b9d227dc8952236596739ec) fix: Support RedisCluster for task command pub/sub messaging
### 📊 Changes
**5 files changed** (+32 additions, -15 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/config.py` (+6 -6)
📝 `backend/open_webui/tasks.py` (+19 -1)
📝 `backend/open_webui/utils/middleware.py` (+4 -6)
📝 `backend/open_webui/utils/tools.py` (+1 -1)
📝 `src/lib/utils/index.ts` (+2 -1)
</details>
### 📄 Description
## Summary
Fixes #19840
When using Redis Cluster, stopping a task via POST /api/tasks/stop/{task_id}
results in AttributeError: 'RedisCluster' object has no attribute 'publish'
## Root Cause
The `redis_send_command()` function directly calls `redis.publish()`, but:
- Standard Redis has a `publish()` method
- RedisCluster does NOT have a `publish()` method that broadcasts to all nodes
- In Redis Cluster architecture, PUBLISH commands are node-local
## Changes
- Modified `backend/open_webui/tasks.py`
- Added `RedisCluster` class import from `redis.cluster`
- Updated `redis_send_command()` to handle both:
- **RedisCluster**: Iterates through all master nodes and publishes to each
- **Standard Redis**: Uses `publish()` normally
## Test
The fix ensures task stop commands reach all worker nodes:
- For RedisCluster: publishes to every master node (cluster-wide broadcast)
- For standard Redis: publishes normally (single node)
## Checklist
- [x] Minimal fix focused on the issue
- [x] No new dependencies added (using existing redis package)
- [x] Backward compatible (standard Redis still works)
- [x] Handles cluster architecture correctly (broadcast to all masters)
---
<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/20746
Author: @YuriNachos
Created: 1/17/2026
Status: ❌ Closed
Base:
main← Head:fix-rediscluster-publish📝 Commits (6)
f84aad5fix: handle None value for model capabilities in builtin_tools check0d4898ffix: handle None value for model capabilities in file_context check9772be0fix: handle None value for capabilities in get_model_capability helper3d404fffix: URL-encode OAuth client secrets to handle special characters3079444fix: Decode HTML entities in tool call results before sending to LLMc1ec294fix: Support RedisCluster for task command pub/sub messaging📊 Changes
5 files changed (+32 additions, -15 deletions)
View changed files
📝
backend/open_webui/config.py(+6 -6)📝
backend/open_webui/tasks.py(+19 -1)📝
backend/open_webui/utils/middleware.py(+4 -6)📝
backend/open_webui/utils/tools.py(+1 -1)📝
src/lib/utils/index.ts(+2 -1)📄 Description
Summary
Fixes #19840
When using Redis Cluster, stopping a task via POST /api/tasks/stop/{task_id}
results in AttributeError: 'RedisCluster' object has no attribute 'publish'
Root Cause
The
redis_send_command()function directly callsredis.publish(), but:publish()methodpublish()method that broadcasts to all nodesChanges
backend/open_webui/tasks.pyRedisClusterclass import fromredis.clusterredis_send_command()to handle both:publish()normallyTest
The fix ensures task stop commands reach all worker nodes:
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.