[PR #23037] [CLOSED] fix: allow tool calls to continue generation for non-admin users #50035

Closed
opened 2026-04-30 02:31:39 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/23037
Author: @yang1002378395-cmyk
Created: 3/25/2026
Status: Closed

Base: devHead: fix-tool-access-22851-v2


📝 Commits (1)

  • 687817b fix: allow tool calls to continue generation for non-admin users

📊 Changes

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

View changed files

📝 backend/open_webui/utils/middleware.py (+2 -0)

📄 Description

Pull Request Checklist

  • Target branch: This PR targets the `dev` branch
  • Description: Fix for Issue #22851 - Tool calls fail for non-admin users
  • Testing: Manually tested by a user in the issue (TheoSlater confirmed the fix works)

Changelog Entry

Description

When a tool call is executed by a non-admin user, the generation stops after the tool result is returned. Admin users are unaffected due to `BYPASS_ADMIN_ACCESS_CONTROL`.

Fixed

  • Added `bypass_filter=True` to `generate_chat_completion` calls after tool execution in the streaming handler
  • This ensures the model access check is skipped for follow-up generations after the user has already been authorized for the initial request

Root Cause

In `streaming_chat_response_handler`, when a tool call completes and the model needs to continue generating the response, the subsequent call to `generate_chat_completion` was missing the `bypass_filter=True` parameter. This caused the model access control check to fail for regular users.

Files Changed

  • `backend/open_webui/utils/middleware.py`: Added `bypass_filter=True` parameter (2 locations)

Testing Evidence

User @TheoSlater in Issue #22851 confirmed this fix resolves the problem:

"This fix works for me"

Fixes #22851


Contributor License Agreement


🔄 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/23037 **Author:** [@yang1002378395-cmyk](https://github.com/yang1002378395-cmyk) **Created:** 3/25/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix-tool-access-22851-v2` --- ### 📝 Commits (1) - [`687817b`](https://github.com/open-webui/open-webui/commit/687817b3ccbb176ccd7b4e75712739088934d6cd) fix: allow tool calls to continue generation for non-admin users ### 📊 Changes **1 file changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/middleware.py` (+2 -0) </details> ### 📄 Description # Pull Request Checklist - [x] **Target branch:** This PR targets the \`dev\` branch - [x] **Description:** Fix for Issue #22851 - Tool calls fail for non-admin users - [x] **Testing:** Manually tested by a user in the issue (TheoSlater confirmed the fix works) ## Changelog Entry ### Description When a tool call is executed by a non-admin user, the generation stops after the tool result is returned. Admin users are unaffected due to \`BYPASS_ADMIN_ACCESS_CONTROL\`. ### Fixed - Added \`bypass_filter=True\` to \`generate_chat_completion\` calls after tool execution in the streaming handler - This ensures the model access check is skipped for follow-up generations after the user has already been authorized for the initial request ### Root Cause In \`streaming_chat_response_handler\`, when a tool call completes and the model needs to continue generating the response, the subsequent call to \`generate_chat_completion\` was missing the \`bypass_filter=True\` parameter. This caused the model access control check to fail for regular users. ### Files Changed - \`backend/open_webui/utils/middleware.py\`: Added \`bypass_filter=True\` parameter (2 locations) ### Testing Evidence User @TheoSlater in Issue #22851 confirmed this fix resolves the problem: > "This fix works for me" ### Related Issues Fixes #22851 --- ### Contributor License Agreement - [x] 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. --- <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-30 02:31:39 -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#50035