mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #20338] [CLOSED] feat: persist filter-modified model ID to message metadata #48622
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/20338
Author: @Classic298
Created: 1/2/2026
Status: ❌ Closed
Base:
dev← Head:filter-access-adjustment📝 Commits (2)
04b03d4Update main.py25f3115add event emitter📊 Changes
2 files changed (+8 additions, -1 deletions)
View changed files
📝
backend/open_webui/main.py(+1 -1)📝
src/lib/components/chat/Chat.svelte(+7 -0)📄 Description
Summary
RELATED / FIXES: https://github.com/open-webui/open-webui/discussions/20294
When a filter function modifies the model in its inlet hook to route messages to a different model, the database now correctly stores the updated model ID. Filters can also emit a chat:model event to update the UI in real-time.
Problem
The model_id variable was captured at the start of the chat_completion function, but the database save was using this pre-captured value instead of the potentially-modified value from form_data after inlet filters run.
Before:
After this feature introduction:
Use Case: Model Routing in Filters
Filter authors can now implement model routing that persists correctly:
The selected model will now be correctly displayed in the chat UI after the response.
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.