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

Closed
opened 2026-04-25 14:26:59 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: mainHead: fix-tool-access-22851


📝 Commits (1)

  • 9571cf6 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

Problem

Fixes #22851

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

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.

Solution

Add bypass_filter=True to both generate_chat_completion calls after tool execution in the streaming handler:

  • Line 4551: Tool result continuation
  • Line 4737: Code interpreter continuation

Testing

  • Tested with non-admin user making tool calls
  • Generation now continues after tool result is returned
  • No changes to security model - this only affects the follow-up generation after the user has already been authorized for the initial request

Files Changed

  • backend/open_webui/utils/middleware.py: Added bypass_filter=True parameter

🔄 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/23036 **Author:** [@yang1002378395-cmyk](https://github.com/yang1002378395-cmyk) **Created:** 3/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-tool-access-22851` --- ### 📝 Commits (1) - [`9571cf6`](https://github.com/open-webui/open-webui/commit/9571cf6154bb44bf1aa3b76993e76c5fad5a951c) 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 ## Problem Fixes #22851 When a tool call is executed by a non-admin user, the generation stops after the tool result is returned. Admin users are unaffected. ## 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. ## Solution Add `bypass_filter=True` to both `generate_chat_completion` calls after tool execution in the streaming handler: - Line 4551: Tool result continuation - Line 4737: Code interpreter continuation ## Testing - Tested with non-admin user making tool calls - Generation now continues after tool result is returned - No changes to security model - this only affects the follow-up generation after the user has already been authorized for the initial request ## Files Changed - `backend/open_webui/utils/middleware.py`: Added `bypass_filter=True` parameter --- <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-25 14:26:59 -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#42616