mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #22404] [CLOSED] fix: Filter out internal tool methods starting with underscore #26661
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22404
Author: @Fu-Jie
Created: 3/8/2026
Status: ❌ Closed
Base:
dev← Head:fix/filter-internal-tool-methods📝 Commits (1)
6f9b698fix: filter out internal tool methods starting with underscore📊 Changes
1 file changed (+2 additions, -2 deletions)
View changed files
📝
backend/open_webui/utils/tools.py(+2 -2)📄 Description
Pull Request Checklist
_in Tools.Toolclass containing public and protected methods. Full testing script and logs included below.Changelog Entry
Description
Currently, the tool extraction logic only filters out dunder methods (
__), causing internal helper/protected methods (starting with a single underscore_) to be exposed as callable Tools to the LLM. This PR updates the filtering to exclude all methods starting with_, following standard Python conventions.Fixed
_) from being extracted as Tools inbackend/open_webui/utils/tools.py.Additional Information
Rationale
Verification Logic
The following complete script was used to verify the fix:
Verification Logs:
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.