fix: tools picked in a new chat are dropped after switching away and back (#32235)

A tool picked from the Integrations menu before the first message of a new chat stayed on only until the user left that chat. Coming back, the chat fell back to the model's default tools, so the tool was no longer offered to the model and the changed tool list broke prompt caching. The Web Search toggle was dropped the same way, and a picked skill was lost on reload. The picks are now kept for the chat from its first message on, like picks made later in the chat.
This commit is contained in:
Classic298 2026-10-12 09:57:30 +02:00 • committed by GitHub
parent 1369027db6
commit 40df1542ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4243,6 +4243,8 @@
});
await chatId.set(res.chat_id);
if (!$temporaryChatEnabled && !embedded) {
// Carry the picks made on the new-chat page over to this chat
saveDraft(getChatInputDraft(), res.chat_id, false);
window.history.replaceState(window.history.state, '', `/c/${res.chat_id}`);
await refreshChatList(localStorage.token);
@ -4505,6 +4507,7 @@
await chatId.set(_chatId);
if (!embedded) {
saveDraft(getChatInputDraft(), _chatId, false);
window.history.replaceState(window.history.state, '', `/c/${_chatId}`);
}