When switching models in chat, previously selected tools were not properly cleared. Two changes in src/lib/components/chat/Chat.svelte:
Simplified the tool assignment when a model has configured toolIds — removed unnecessary new Set wrapping and directly filter by available tools
Fixed the else branch — when a model has no configured tools and no user default tools, clear selectedToolIds entirely instead of keeping previous tools (minus direct_server: ones)
Test plan
Select a model with configured tools → verify its tools appear
Switch to a model with different tools → verify only the new model's tools are shown
Switch to a model with no configured tools → verify tools are cleared
Verify user default tools ($settings.tools) still work as fallback
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/22292
**Author:** [@zspirit](https://github.com/zspirit)
**Created:** 3/6/2026
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `fix/tool-selection-on-model-switch`
---
### 📝 Commits (1)
- [`28ebbcb`](https://github.com/open-webui/open-webui/commit/28ebbcbd903ff2fb9d0168e714f01754e902f4d2) fix tool selection not reset on model switch
### 📊 Changes
**1 file changed** (+4 additions, -6 deletions)
<details>
<summary>View changed files</summary>
📝 `src/lib/components/chat/Chat.svelte` (+4 -6)
</details>
### 📄 Description
## Summary
Fixes #14157
When switching models in chat, previously selected tools were not properly cleared. Two changes in `src/lib/components/chat/Chat.svelte`:
- **Simplified the tool assignment** when a model has configured `toolIds` — removed unnecessary `new Set` wrapping and directly filter by available tools
- **Fixed the else branch** — when a model has no configured tools and no user default tools, clear `selectedToolIds` entirely instead of keeping previous tools (minus `direct_server:` ones)
## Test plan
- [ ] Select a model with configured tools → verify its tools appear
- [ ] Switch to a model with different tools → verify only the new model's tools are shown
- [ ] Switch to a model with no configured tools → verify tools are cleared
- [ ] Verify user default tools (`$settings.tools`) still work as fallback
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22292
Author: @zspirit
Created: 3/6/2026
Status: ❌ Closed
Base:
main← Head:fix/tool-selection-on-model-switch📝 Commits (1)
28ebbcbfix tool selection not reset on model switch📊 Changes
1 file changed (+4 additions, -6 deletions)
View changed files
📝
src/lib/components/chat/Chat.svelte(+4 -6)📄 Description
Summary
Fixes #14157
When switching models in chat, previously selected tools were not properly cleared. Two changes in
src/lib/components/chat/Chat.svelte:toolIds— removed unnecessarynew Setwrapping and directly filter by available toolsselectedToolIdsentirely instead of keeping previous tools (minusdirect_server:ones)Test plan
$settings.tools) still work as fallback🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.