mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[PR #23107] [CLOSED] fix: make FileModelResponse.meta optional to handle NULL database values #42662
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/23107
Author: @yang1002378395-cmyk
Created: 3/26/2026
Status: ❌ Closed
Base:
dev← Head:fix-filemeta-required📝 Commits (3)
dc22bb2fix: preserve prefilled input value in input event dialog28926d2fix: prevent infinite loop when streaming response sends finish_reason: stop followed by tool_callsa246673fix: make FileModelResponse.meta optional to handle NULL database values📄 Description
Pull Request Checklist
Changelog Entry
Description
Fix HTTP 500 Internal Server Error when calling the files list API on databases containing NULL meta values.
Fixed
FileMetatoOptional[FileMeta] = Noneto handle legacy database records with NULL meta fieldRoot Cause
In v0.8.11,
FileModelResponse.metawas changed fromOptional[dict]to requiredFileMetatype. When the database contains NULL for the meta field (common in legacy records), Pydantic raises ValidationError becauseFileMetacannot be None.Error chain:
get_file_list()returnslist[FileModel]FileListResponse(items=...)coerces each toFileModelResponseFileModelResponse.meta: FileMetais requiredFileMeta.sanitize_meta(None)returns NoneFixes #23101
Testing
✅ Personally tested: Yes
How I tested:
FileMetatype rejects None, Optional accepts itImpact
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.