mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #24092] Bug: Task endpoints (title/tags/follow-up generation) return 404 when chat model is from a direct connection #58848
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?
Originally created by @champumbc on GitHub (Apr 24, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24092
Check Existing Issues
Installation Method
Docker (ECS Fargate)
Open WebUI Version
v0.9.2
Ollama Version (if applicable)
N/A (Ollama disabled)
Operating System
Linux (AWS Fargate ARM64)
Browser (if applicable)
All browsers
Confirmation
README.md.Expected Behavior
When a user chats using a model from a direct connection (e.g.,
gpt-4ovia their own OpenAI API key), and a Task Model is configured in Admin Settings (e.g., "Amazon Nova Micro" from a server-level OpenAI connection), the task endpoints (/api/v1/tasks/title/completions,/api/v1/tasks/tags/completions, etc.) should use the configured Task Model to generate titles, tags, follow-ups, etc.Actual Behavior
All task endpoints return HTTP 404 with "MODEL_NOT_FOUND" when the chat model comes from a direct connection, because the chat model ID is not present in
request.app.state.MODELS. The configured Task Model fallback never executes.Server log:
Root Cause
In
backend/open_webui/routers/tasks.py, thegenerate_titlefunction (and all similar task endpoints) validates the chat model before callingget_task_model_id():The model existence check on the chat model at line ~165 runs before
get_task_model_id()at line ~173. Since direct connection models are not inrequest.app.state.MODELS, the 404 is raised before the task model override can resolve to the configured server-side model.This same pattern affects all task endpoints:
title/completions,tags/completions,follow_up/completions,queries/completions,auto/completions,emoji/completions,moa/completions, andimage_prompt/completions.Steps to Reproduce
ENABLE_DIRECT_CONNECTIONS=trueandENABLE_OLLAMA_API=Falsegpt-4o)gpt-4o)POST /api/v1/tasks/title/completions HTTP/1.1" 404Suggested Fix
Move the model existence validation to after
get_task_model_id()resolves the actual model to be used, and validate the resolvedtask_model_idinstead of the chatmodel_id:Note:
get_task_model_id()would also need a small adjustment — when the chat model isn't inmodels, theconnection_typelookup fails, so the function should default to trying the external task model when the chat model is unknown:Environment
ENABLE_DIRECT_CONNECTIONS=trueENABLE_OLLAMA_API=False@champumbc commented on GitHub (Apr 24, 2026):
In the interest of full disclosure - I worked with Claude code to create this issue, but the problem is indeed verified by me.
@champumbc commented on GitHub (Apr 24, 2026):
PR with fix: https://github.com/open-webui/open-webui/pull/24099
@champumbc commented on GitHub (Apr 24, 2026):
PR with fix: https://github.com/open-webui/open-webui/pull/24100 (replaces #24099 which had wrong base branch)