mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[PR #24661] [CLOSED] fix: fallback to first available model when model_id is missing or empty #115072
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/24661
Author: @yahyasaqban-lab
Created: 5/13/2026
Status: ❌ Closed
Base:
main← Head:fix/auto-title-empty-model📝 Commits (1)
304d97afix: fallback to first available model when model_id is missing or empty📊 Changes
1 file changed (+56 additions, -32 deletions)
View changed files
📝
backend/open_webui/routers/tasks.py(+56 -32)📄 Description
Summary
Fixes auto-title generation when the frontend sends an empty or missing model_id. Instead of returning a 404 error, the backend gracefully falls back to the first available model.
Problem
When users click the "regenerate title" icon (stars icon) on a chat that doesn't have a model assigned, the frontend sends
model: ""to/api/title/completions. The backend then returns:This started happening because the frontend fallback logic at
ChatItem.sveltelinemodels.at(0) ?? '''''evaluates to empty string when no models exist in the chat data.Fix
Applied to all task endpoints in
tasks.py:model_idis empty or missing and there are no models, still return 404model_idis not found but models exist, fall back to the first available modelRelated
Closes #24604
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.