mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #22408] [MERGED] fix: filter out internal tool methods starting with underscore #26665
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/22408
Author: @Fu-Jie
Created: 3/8/2026
Status: ✅ Merged
Merged: 3/8/2026
Merged by: @tjbck
Base:
dev← Head:fix/filter-internal-tool-methods-final📝 Commits (1)
2aefb4cfix: 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 to prevent exposure to LLM.verify_with_logs.py(details below).Changelog Entry
Description
Currently, the tool extraction logic in
backend/open_webui/utils/tools.pyonly 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
_, adhering to standard Python conventions.Fixed
_) from being extracted as Tools inbackend/open_webui/utils/tools.py.Additional Information
Rationale
_is the definitive convention for marking protected/internal methods. These should not be part of the object's public tool interface.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.