[PR #22972] [CLOSED] fix(ui): use default model for new chat instead of inheriting current model #42582

Closed
opened 2026-04-25 14:25:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22972
Author: @BillionClaw
Created: 3/24/2026
Status: Closed

Base: mainHead: fix/new-chat-use-default-model


📝 Commits (1)

  • 5ff9558 fix(ui): use default model for new chat instead of inheriting current model

📊 Changes

1 file changed (+5 additions, -3 deletions)

View changed files

📝 src/lib/components/chat/Chat.svelte (+5 -3)

📄 Description

Description

When clicking 'New Chat' while viewing an active chat with a non-default model, the new chat incorrectly inherits the current model instead of using the configured default model.

Root Cause

The model selector persists the selected model in the URL search params (?models=...). When navigating to a new chat via 'New Chat', the URL is not cleared of these model search params, causing the Chat component's init() to read the stale model from the URL instead of using the configured default.

Fix

Clear the 'models' and 'model' URL search params when resetting state for a new chat, ensuring the configured default model is always used.

Steps to Reproduce (before fix)

  1. Configure a default model in Admin/User settings (Model A)
  2. Start a chat and switch to a different model (Model B)
  3. Click 'New Chat' while Model B is active
  4. New chat incorrectly uses Model B instead of Model A

Steps to Verify (after fix)

  1. Configure a default model (Model A)
  2. Start a chat and switch to a different model (Model B)
  3. Click 'New Chat'
  4. New chat now correctly uses Model A

Fixes #22957


🔄 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/22972 **Author:** [@BillionClaw](https://github.com/BillionClaw) **Created:** 3/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/new-chat-use-default-model` --- ### 📝 Commits (1) - [`5ff9558`](https://github.com/open-webui/open-webui/commit/5ff9558835da8a5e29ad1afa5f29386b84dbaea0) fix(ui): use default model for new chat instead of inheriting current model ### 📊 Changes **1 file changed** (+5 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/components/chat/Chat.svelte` (+5 -3) </details> ### 📄 Description ## Description When clicking 'New Chat' while viewing an active chat with a non-default model, the new chat incorrectly inherits the current model instead of using the configured default model. ### Root Cause The model selector persists the selected model in the URL search params (?models=...). When navigating to a new chat via 'New Chat', the URL is not cleared of these model search params, causing the Chat component's init() to read the stale model from the URL instead of using the configured default. ### Fix Clear the 'models' and 'model' URL search params when resetting state for a new chat, ensuring the configured default model is always used. ### Steps to Reproduce (before fix) 1. Configure a default model in Admin/User settings (Model A) 2. Start a chat and switch to a different model (Model B) 3. Click 'New Chat' while Model B is active 4. New chat incorrectly uses Model B instead of Model A ### Steps to Verify (after fix) 1. Configure a default model (Model A) 2. Start a chat and switch to a different model (Model B) 3. Click 'New Chat' 4. New chat now correctly uses Model A Fixes #22957 --- <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-25 14:25:54 -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#42582