[PR #22292] [CLOSED] fix: reset tool selection when switching models #26593

Closed
opened 2026-04-20 06:35:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22292
Author: @zspirit
Created: 3/6/2026
Status: Closed

Base: mainHead: fix/tool-selection-on-model-switch


📝 Commits (1)

  • 28ebbcb fix 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:

  • 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>
GiteaMirror added the pull-request label 2026-04-20 06:35:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#26593