open-webui/backend/open_webui
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
internal perf: route native JSON columns through JSONCodec instead of stdlib json (#28396) 2026-08-10 19:39:49 -05:00
migrations refac 2026-08-10 23:22:08 -06:00
models refac 2026-08-11 01:15:05 -06:00
retrieval refac 2026-08-10 23:40:31 -06:00
routers refac 2026-08-11 01:15:05 -06:00
socket refac 2026-08-10 23:13:10 -06:00
static refac 2026-07-27 19:39:36 -04:00
storage refac 2026-07-31 17:41:14 -04:00
tools refac 2026-08-10 20:13:03 -06:00
utils fix: stop replaying encrypted reasoning_details to a different model after a mid-chat model switch 2026-08-07 12:57:10 +02:00
__init__.py refac 2026-07-27 19:39:36 -04:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py refac 2026-08-11 01:15:05 -06:00
constants.py refac 2026-07-27 19:39:36 -04:00
env.py fix: make the aiodns resolver opt-in and pin aiodns to 3.6.1 (#28242) 2026-08-10 19:52:29 -06:00
events.py refac 2026-08-10 23:13:10 -06:00
functions.py perf: build debug log messages lazily so disabled debug logs cost nothing (#27834) 2026-07-31 19:09:01 -05:00
main.py fix: send stream_options.include_usage for backend-initiated chats (#27661) 2026-08-10 23:30:46 -06:00
tasks.py refac 2026-07-31 17:41:14 -04:00