open-webui/backend
Claude ae8ef975ea
fix: apply custom model fallback before the base-model access check
With ENABLE_CUSTOM_MODEL_FALLBACK enabled, chatting with a custom
workspace model whose base model was removed still failed with "Model
not found" for non-admin users. The access check ran before the
fallback resolution and walked the preset's base_model_id chain;
has_base_model_access treats a base model without a model-table row as
admin-only, so regular users were rejected before the fallback to the
default (Selected) model could ever apply. Admins bypass the access
check by default, which is why the fallback only appeared to work for
them.

Resolve the fallback model first, and when one applies, skip the
missing base-model hop on the requested preset and enforce access on
the fallback model that will actually serve the chat instead.
check_model_access gains a check_base_model flag for this; all other
callers keep the default chain enforcement.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sc922g12Yp16TdcCt74AWi
2026-08-12 11:38:16 +00:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
open_webui fix: apply custom model fallback before the base-model access check 2026-08-12 11:38:16 +00:00
.dockerignore fix: litellm config issue 2024-02-24 22:35:11 -08:00
.gitignore refac 2024-09-06 04:59:20 +02:00
dev.sh refac 2026-03-24 19:43:30 -05:00
requirements-min.txt perf: optional orjson JSON codec behind ENABLE_ORJSON (#27583) 2026-07-27 03:45:37 -04:00
requirements.txt fix: make the aiodns resolver opt-in and pin aiodns to 3.6.1 (#28242) 2026-08-10 19:52:29 -06:00
start.sh refac 2026-06-17 03:01:11 +02:00
start_windows.bat fix: generate valid WEBUI_SECRET_KEY in start_windows.bat (#28061) 2026-08-10 23:22:43 -06:00