mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 04:16:03 -05:00
[PR #23106] [CLOSED] fix: make FileModelResponse.meta optional to handle NULL database values #50079
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/23106
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
Summary
Fixes #23101 - API call "list files" produces HTTP 500 Internal Server Error
Root 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 NoneFix
Change
meta: FileMetatometa: Optional[FileMeta] = Noneto allow NULL values from database.Testing
✅ Personally tested: Yes
How I tested:
FileMetatype rejects None, Optional accepts itImpact
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.