[PR #20751] [CLOSED] fix: handle None value for capabilities in get_model_capability helper #25764

Closed
opened 2026-04-20 06:06:57 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/20751
Author: @YuriNachos
Created: 1/17/2026
Status: Closed

Base: devHead: fix-20565-capabilities-none-check


📝 Commits (1)

  • 4e3856a fix: handle None value for capabilities in get_model_capability helper

📊 Changes

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

View changed files

📝 backend/open_webui/utils/tools.py (+1 -1)

📄 Description

Description

  • Fixes #20565 - AttributeError when model capabilities are None

Added

  • N/A

Changed

  • Added or {} to handle None value for capabilities in get_model_capability() helper function

Deprecated

  • N/A

Removed

  • N/A

Fixed

  • Model capabilities check: Fixed AttributeError when model metadata capabilities field is None
  • Previously, when a model's meta.capabilities was None, calling .get() on it would crash
  • Now the code properly converts None to empty dict before accessing capabilities
  • Affects models imported from external OpenAI-compatible connections with incomplete metadata

Security

  • N/A

Breaking Changes

  • N/A

Additional Information

  • Issue: [PR #1062] [MERGED] Remove extra 'S' in 'ASSISTANT' (#20565)
  • Applies the same fix pattern used in middleware.py to the get_model_capability() helper in tools.py
  • Example affected models: XiaomiMiMo/MiMo-V2-Flash and others with capabilities: None in metadata
  • Workaround of re-saving models in Admin Panel is no longer needed

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.


🔄 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/20751 **Author:** [@YuriNachos](https://github.com/YuriNachos) **Created:** 1/17/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix-20565-capabilities-none-check` --- ### 📝 Commits (1) - [`4e3856a`](https://github.com/open-webui/open-webui/commit/4e3856a9be065577872235b123dca0ee688d3fd1) fix: handle None value for capabilities in get_model_capability helper ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/tools.py` (+1 -1) </details> ### 📄 Description ### Description - Fixes #20565 - AttributeError when model capabilities are None ### Added - N/A ### Changed - Added `or {}` to handle None value for capabilities in `get_model_capability()` helper function ### Deprecated - N/A ### Removed - N/A ### Fixed - **Model capabilities check**: Fixed AttributeError when model metadata capabilities field is None - Previously, when a model's `meta.capabilities` was `None`, calling `.get()` on it would crash - Now the code properly converts None to empty dict before accessing capabilities - Affects models imported from external OpenAI-compatible connections with incomplete metadata ### Security - N/A ### Breaking Changes - N/A --- ### Additional Information - Issue: #20565 - Applies the same fix pattern used in `middleware.py` to the `get_model_capability()` helper in `tools.py` - Example affected models: XiaomiMiMo/MiMo-V2-Flash and others with `capabilities: None` in metadata - Workaround of re-saving models in Admin Panel is no longer needed ### Contributor License Agreement 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-20 06:06:57 -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#25764