fix: user can no longer chat after losing access to model controls they had used (#32194)

A user who had picked an option in a model control (the per-model selector in the chat input, for example High on a Thinking control) could not chat any more once the admin switched off Allow Chat Controls or Allow Chat Params for them. Every message failed with "You cannot change model parameters.", and the user could not clear the saved selection because the selector is hidden for them. When either permission is off, the saved selection is now skipped when sending, so messages go through with the model's default options, and it applies again if the permission comes back.

Fixes #31995
This commit is contained in:
Classic298 2026-10-10 18:09:31 +02:00 • committed by GitHub
parent ab15284a47
commit 9b3d599c75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1202,7 +1202,8 @@ async def chat_completion(
permissions = await Config.get('user.permissions')
for permission in ('chat.controls', 'chat.params'):
if not await has_permission(user.id, permission, permissions):
raise HTTPException(403, 'You cannot change model parameters.')
model_controls = {}
break
if missing_base_model and model_controls.get(model_id):
raise HTTPException(400, 'Model control options cannot be applied to the fallback model.')
if model_info_params or request_params: