mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-06 02:48:04 +00:00
fix: keep arena model access after editing it in Settings > Models (#31309)
Saving an arena model in Admin Settings > Models (for example to set default tools or capabilities) creates a model entry with the arena id. That entry replaced the arena model's metadata wholesale, dropping the access grants, model_ids and filter_mode configured in Admin Settings > Evaluations. From then on every non-admin user lost the arena model, even when it was public, and chats through it ignored the configured model pool. The override now keeps those three keys from the evaluation config, which is where arena access and the model pool are managed. Everything else set in Settings > Models (tools, capabilities, description, profile image) still applies. Verified end to end on base and patched: after the override a user sees and can chat with a public arena model (base: hidden, 400), private arena models stay hidden, and 20 admin chats all route to the configured pool (base: spread across all models). Fixes #29564
This commit is contained in:
parent
35dda256f0
commit
b8de508dbc
1 changed files with 10 additions and 0 deletions
|
|
@ -182,8 +182,18 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None)
|
|||
|
||||
if model:
|
||||
if custom_model.is_active:
|
||||
arena_meta = model['info']['meta'] if model.get('arena') else None
|
||||
model['name'] = custom_model.name
|
||||
model['info'] = custom_model.model_dump()
|
||||
if arena_meta:
|
||||
# Evaluation config owns arena access grants and model_ids
|
||||
model['info']['meta'].update(
|
||||
{
|
||||
key: arena_meta[key]
|
||||
for key in ('access_grants', 'model_ids', 'filter_mode')
|
||||
if key in arena_meta
|
||||
}
|
||||
)
|
||||
schema = get_chat_variables_schema(custom_model.params.model_dump().get('system'))
|
||||
if schema:
|
||||
model['info'].setdefault('meta', {})['chat_variables_schema'] = schema
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue