Repository navigation
fix(studio): preserve chat tool selections across model unloads - #13621
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This one is specific to this PR; the test passes on current If keeping deep research on across an unload is intended, the assertion at The other reds on this PR are fixed on |
…rence A pill now follows the live store unless the selected model clamps it off or a model is still loading. In those cases the chat's stored value stands in, so a clamp never overwrites the preference and the composer never shows a tool the model cannot run. - Kimi: a non-persisted Search-off is no longer re-armed from storage, so opening or leaving a chat keeps Thinking on. - A settings write during a model load no longer stores the previous model's clamp over the chat's Search, Code or Research. - Unloading re-derives the clamped pills from the preference, so a provider default does not outlive its model. - Restoring defaults after a held edit, and applying a chat's stored pills, both go through the capability clamp. - Revert the out-of-scope composer gating port; keep only the Research menu gate for local models without tools. - Re-pin the deep research contract test to the new setCheckpoint rule.
A pill's recorded value now follows the live store while the chat's settings write is still waiting on its debounce, the same way that write reads it, unless the model clamps the pill off or is loading. It used to keep the value from the moment of the click, so a change that does not persist, such as Kimi turning Search off when Thinking is enabled, could be undone by switching models before the write ran. - Kimi: Search, then Thinking, then a quick switch to another provider no longer turns Search back on or saves it as on. - The external model patch reapplied after a cancelled local load no longer carries a cached Research value, so a Research click made in between is kept. setCheckpoint and the chat page's provider effect already set Research for the new model. - Tests cover both Kimi orderings and the incognito checks on the Research paths, and the reload matrix only checks the pills a local load controls. - The deep research contract test drops two assertions that also matched upstream and pins the Research menu clause instead. - Remove comment text that no longer matches the code and restore the still accurate part of an upstream doc comment.
Three places where the branch had moved away from upstream behaviour. - Research support for an external model is read from the providers store with the same rule the composer menu uses. The previous lookup parsed the provider list from localStorage on every snapshot and hydration pass. When that read failed it refused Research while the menu item stayed enabled, so the click did nothing. - A chat's own pill override no longer falls back to the default captured when the chat was opened. Chats saved before the pill keys existed reach the stored global value and the provider default again, so picking Anthropic or OpenAI in one turns Search on as upstream does. - A same-model reload keeps the Search and Code pills the model was running with, as upstream does, instead of reading them back from storage, which can hold a stale value after a failed write. - Tests cover each case.
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
# Conflicts: # studio/frontend/scripts/check-bundle-budget.ts
# Conflicts: # studio/frontend/scripts/check-bundle-budget.ts
# Conflicts: # studio/frontend/scripts/check-bundle-budget.ts
Unloading a model cleared the chat’s tool selections and could save those cleared values back into the chat. Preserve Search, Code, and other tool selections across model unload/reload using the existing settings persistence. Model capabilities and transient runtime state still reset normally.
Validation:
Before / after
Same chat,
unsloth/Qwen3-0.6B-GGUF: Search and Tools turned on, then picker > Eject model, then the same model loaded again. Before, both pills come back off and the chat stores them off; with this PR they stay on (the reloaded prompt carries the tool definitions again, 43 -> 961 tokens). MCP and RAG selections also survive an unload now.