fix: apply the selected model's tools and skills when starting a chat from the sidebar

Clicking a pinned model in the sidebar started a new chat with that model but sent the previous model's tool_ids and skill_ids, and they stayed until the page was reloaded. The model dropdown was unaffected, and so was temporary chat.

A pinned entry links to /?model=<id>, which runs the new-chat path. That path applied the model's defaults and then restored the composer draft over the top, and the draft still held the selection from whichever model was active when it was written. The draft save is debounced, so the stale value was reliably the one read back.

The draft is now restored before the defaults are applied, so the model always decides which tools and skills are active while the unsent prompt, files and approval mode are still kept. Starting a new chat with several models selected now clears the selection instead of carrying the draft's over, since there are no per-model defaults to apply in that case.
This commit is contained in:
Claude 2026-08-26 11:24:01 +00:00
parent 56d296ef1b
commit c85eb22eeb
No known key found for this signature in database

View file

@ -2113,8 +2113,9 @@
autoScroll = true;
await resetInput();
// resetInput() must stay last: the selected model's defaults override the draft's selection.
await restoreChatInput(sessionStorage.getItem('chat-input'));
await resetInput();
await chatId.set('');
await chatTitle.set('');