mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
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/20743
Author: @YuriNachos
Created: 1/17/2026
Status: ❌ Closed
Base:
main← Head:fix-model-capabilities-none-check📝 Commits (3)
f84aad5fix: handle None value for model capabilities in builtin_tools check0d4898ffix: handle None value for model capabilities in file_context check9772be0fix: handle None value for capabilities in get_model_capability helper📊 Changes
2 files changed (+5 additions, -7 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+4 -6)📝
backend/open_webui/utils/tools.py(+1 -1)📄 Description
Summary
Fixes #20565
When model.info.meta.capabilities is None (null), the code crashes with:
Root Cause
The dict.get(key, default) method returns the value if the key exists, even if that value is None. The default value is only used when the key is missing. So
.get("capabilities", {})returns None when the capabilities key exists but has value None, rather than returning the default {}.Changes
backend/open_webui/utils/middleware.py(2 locations)builtin_tools_enabledcheck at line 1813file_context_enabledcheck at line 1860backend/open_webui/utils/tools.pyget_model_capability()helper function at line 402.get("capabilities", {})to.get("capabilities") or {}in all 3 locationsTest
Manual testing confirmed:
The fix preserves default behavior (True for both builtin_tools and file_context when not specified) while preventing the AttributeError crash.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.