[PR #20326] [CLOSED] fix: pass request when updating channel messages #25568

Closed
opened 2026-04-20 06:00:11 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/20326
Author: @rbb-dev
Created: 1/2/2026
Status: Closed

Base: devHead: fix/channels-model-response-update-request


📝 Commits (9)

📊 Changes

1 file changed (+2 additions, -0 deletions)

View changed files

📝 backend/open_webui/routers/channels.py (+2 -0)

📄 Description

Pull Request Checklist

Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.

This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR.

Before submitting, make sure you've checked the following:

  • Target branch: This pull request targets the dev branch.
  • Description: Provided below.
  • Changelog: Added at the bottom of this PR description.
  • Documentation: Not required (no user-facing config/API changes).
  • Dependencies: No new dependencies.
  • Testing: Manually tested the Channels model mention auto-reply flow (details below).
  • Agentic AI Code: Parts of analysis were assisted by an AI tool, but the final patch was reviewed by me and manually tested. I’m responsible for the change.
  • Code review: Performed self-review; change is minimal and scoped.
  • Title Prefix: fix

Description

Channels “model mention” auto-replies (e.g. mentioning a model in a channel thread) can get stuck in a perpetual loading state. The backend logs show an exception:

'str' object has no attribute 'app' from open_webui.routers.channels:model_response_handler.

Root cause: update_message_by_id was updated to require request: Request (and now calls check_channels_access(request)), but model_response_handler still invoked it with the legacy positional argument list, passing channel.id into the request slot. This raises, the exception is swallowed, and the placeholder message never gets updated to done=true, leaving the UI spinner running forever.

This PR fixes the two call sites in model_response_handler to pass request as the first argument.

Testing / Verification (Manual)

  • Environment: Open WebUI v0.6.42+ (reproduced on v0.6.43)
  • Steps:
    1. Create/open a Channel.
    2. Mention a model in a message (model mention/auto-reply).
    3. Observe that a placeholder model message is created.
    4. Confirm the model reply is now updated and marked done (spinner stops) and no 'str' object has no attribute 'app' is logged.
  • Result: Works as expected; placeholder message updates correctly and UI no longer hangs.

Screenshots or Videos

  • N/A (can add if requested)

Changelog Entry

Description

Fix Channels model mention auto-replies getting stuck in “generating” state due to an internal call to update_message_by_id missing the request argument.

Added

  • N/A

Changed

  • N/A

Deprecated

  • N/A

Removed

  • N/A

Fixed

  • Channels model_response_handler now correctly passes request when updating the placeholder message, preventing 'str' object has no attribute 'app' and allowing the message to be updated to done=true.

Security

  • N/A

Breaking Changes

  • BREAKING CHANGE: N/A

Additional Information

  • Related to regression introduced when Channels endpoints enforced global ENABLE_CHANNELS via check_channels_access(request) and updated endpoint signatures to include request: Request.

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.

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 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/20326 **Author:** [@rbb-dev](https://github.com/rbb-dev) **Created:** 1/2/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/channels-model-response-update-request` --- ### 📝 Commits (9) - [`fe6783c`](https://github.com/open-webui/open-webui/commit/fe6783c16699911c7be17392596d579333fb110c) Merge pull request #19030 from open-webui/dev - [`fc05e0a`](https://github.com/open-webui/open-webui/commit/fc05e0a6c5d39da60b603b4d520f800d6e36f748) Merge pull request #19405 from open-webui/dev - [`e3faec6`](https://github.com/open-webui/open-webui/commit/e3faec62c58e3a83d89aa3df539feacefa125e0c) Merge pull request #19416 from open-webui/dev - [`9899293`](https://github.com/open-webui/open-webui/commit/9899293f050ad50ae12024cbebee7e018acd851e) Merge pull request #19448 from open-webui/dev - [`140605e`](https://github.com/open-webui/open-webui/commit/140605e660b8186a7d5c79fb3be6ffb147a2f498) Merge pull request #19462 from open-webui/dev - [`6f1486f`](https://github.com/open-webui/open-webui/commit/6f1486ffd0cb288d0e21f41845361924e0d742b3) Merge pull request #19466 from open-webui/dev - [`d95f533`](https://github.com/open-webui/open-webui/commit/d95f533214e3fe5beb5e41ec1f349940bc4c7043) Merge pull request #19729 from open-webui/dev - [`a727153`](https://github.com/open-webui/open-webui/commit/a7271532f8a38da46785afcaa7e65f9a45e7d753) 0.6.43 (#20093) - [`fd35ea2`](https://github.com/open-webui/open-webui/commit/fd35ea20b7d8c3e5c4396397f4d3eccbdce8a2cb) fix: pass request when updating channel messages ### 📊 Changes **1 file changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/routers/channels.py` (+2 -0) </details> ### 📄 Description # Pull Request Checklist ### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request. This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR. **Before submitting, make sure you've checked the following:** - [x] **Target branch:** This pull request targets the `dev` branch. - [x] **Description:** Provided below. - [x] **Changelog:** Added at the bottom of this PR description. - [ ] **Documentation:** Not required (no user-facing config/API changes). - [ ] **Dependencies:** No new dependencies. - [x] **Testing:** Manually tested the Channels model mention auto-reply flow (details below). - [x] **Agentic AI Code:** Parts of analysis were assisted by an AI tool, but the final patch was reviewed by me and manually tested. I’m responsible for the change. - [x] **Code review:** Performed self-review; change is minimal and scoped. - [x] **Title Prefix:** `fix` ## Description Channels “model mention” auto-replies (e.g. mentioning a model in a channel thread) can get stuck in a perpetual loading state. The backend logs show an exception: `'str' object has no attribute 'app'` from `open_webui.routers.channels:model_response_handler`. Root cause: `update_message_by_id` was updated to require `request: Request` (and now calls `check_channels_access(request)`), but `model_response_handler` still invoked it with the legacy positional argument list, passing `channel.id` into the `request` slot. This raises, the exception is swallowed, and the placeholder message never gets updated to `done=true`, leaving the UI spinner running forever. This PR fixes the two call sites in `model_response_handler` to pass `request` as the first argument. ## Testing / Verification (Manual) - Environment: Open WebUI `v0.6.42+` (reproduced on `v0.6.43`) - Steps: 1. Create/open a Channel. 2. Mention a model in a message (model mention/auto-reply). 3. Observe that a placeholder model message is created. 4. Confirm the model reply is now updated and marked done (spinner stops) and no `'str' object has no attribute 'app'` is logged. - Result: Works as expected; placeholder message updates correctly and UI no longer hangs. ## Screenshots or Videos - N/A (can add if requested) --- # Changelog Entry ### Description Fix Channels model mention auto-replies getting stuck in “generating” state due to an internal call to `update_message_by_id` missing the `request` argument. ### Added - N/A ### Changed - N/A ### Deprecated - N/A ### Removed - N/A ### Fixed - Channels `model_response_handler` now correctly passes `request` when updating the placeholder message, preventing `'str' object has no attribute 'app'` and allowing the message to be updated to `done=true`. ### Security - N/A ### Breaking Changes - **BREAKING CHANGE**: N/A --- ### Additional Information - Related to regression introduced when Channels endpoints enforced global `ENABLE_CHANNELS` via `check_channels_access(request)` and updated endpoint signatures to include `request: Request`. ### 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)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 06:00:11 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#25568