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/20753
Author: @Classic298
Created: 1/17/2026
Status: ❌ Closed
Base:
dev← Head:fix-none-capability📝 Commits (1)
2f3f098fix: handle None value for capabilities📊 Changes
1 file changed (+6 additions, -1 deletions)
View changed files
📝
backend/open_webui/models/models.py(+6 -1)📄 Description
Tested locally, works
Fixes https://github.com/open-webui/open-webui/issues/20565
Solution
Added a Pydantic field_validator to the ModelMeta class that normalizes None to an empty dict during deserialization. This fixes the issue at the data source, so all existing and future code paths automatically receive a valid dict instead of None.
The fix is applied at read-time, so existing models with null capabilities in the database are automatically corrected when loaded - no database migration required.
Changes
Testing
Verified that ModelMeta(capabilities=None).capabilities returns {} and subsequent .get() calls work correctly.
Prevents
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.