mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #23738] [CLOSED] fix: clear incompatible tools when switching models #50393
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/23738
Author: @armorbreak001
Created: 4/15/2026
Status: ❌ Closed
Base:
dev← Head:fix/14157-clear-tools-on-model-switch📝 Commits (1)
3cb7beefix: clear incompatible tools when switching models📊 Changes
1 file changed (+6 additions, -1 deletions)
View changed files
📝
src/lib/components/chat/Chat.svelte(+6 -1)📄 Description
Summary
Fixes #14157 — When switching from a model with associated tools to a model without those tools, the previously selected tools remained incorrectly active.
Description
Root Cause
In
setDefaults(), when a model does not definetoolIds, the code fell back to applying.tools(global user settings) unconditionally. This meant tools configured for one model would persist when switching to a different model that does not support them.Fix
Filter the global settings tools against the current model's known tool and filter IDs before applying. Only tools that are actually compatible with the selected model will be activated.
Type of Change
Test Plan
docker compose up -dChangelog Entry
Fixed
Checklist
dev✅fix:— Bug fix ✅CLA
✅ I have read and agree to the Contributor License Agreement of Open WebUI.
By submitting this PR, I confirm that I have personally tested all changes and they work as intended.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.