open-webui/backend
Classic298 d8ceb45baa fix: stop replaying encrypted reasoning_details to a different model after a mid-chat model switch
Switching models mid-chat after a reasoning model responded breaks the chat permanently: stored reasoning_details of type reasoning.encrypted (or carrying a signature) are cryptographically bound to the model that produced them, and the new model's provider rejects every subsequent request, including retries and forks.

Each assistant message already records which model produced it. On request build, when that model differs from the current target, the bound entries are now dropped from its reasoning_details while plain text and summary entries are kept, so the new model still sees what the previous one was thinking. Same-model requests are untouched, since Anthropic-family models require their signed reasoning blocks back and replaying reasoning saves tokens.

The filter sits in process_messages_with_output, the single point every outbound message list passes through, so persisted chats, continue-generation and temporary chats are all covered. Filtering at request time rather than stripping at save keeps the stored data intact: switching back to the original model replays its reasoning again. Messages saved before this change have no model recorded and are left as-is.

Fixes #28240
2026-08-07 12:57:10 +02:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
open_webui fix: stop replaying encrypted reasoning_details to a different model after a mid-chat model switch 2026-08-07 12:57:10 +02: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