Studio: drop the redundant deep-research persistence change

setCheckpoint already persists Deep Research off for external models at the top of the function, so the added saveBool was a duplicate, and clearing Deep Research from setWebFetchToolsEnabled guarded a state that is not reachable (Deep Research is local-model only while the Web Fetch pill is external-provider only). Revert both to the pre-hardening version.
This commit is contained in:
danielhanchen 2026-07-19 10:05:45 +00:00
commit 8513a9108b

View file

@ -1432,12 +1432,6 @@ export const useChatRuntimeStore = create<ChatRuntimeStore>((set, get) => ({
nextMaxTokens = cap;
}
}
// Persist Deep Research off when switching to an external model so a refresh
// does not rehydrate it (the adapter requires a selected local model).
// Mirrors setIncognito / clearCheckpoint / the tool-mode setters.
if (isExternalModelId(modelId)) {
saveBool(CHAT_DEEP_RESEARCH_ENABLED_KEY, false);
}
return {
params: {
...state.params,
@ -1754,12 +1748,7 @@ export const useChatRuntimeStore = create<ChatRuntimeStore>((set, get) => ({
setWebFetchToolsEnabled: (webFetchToolsEnabled) =>
set(() => {
saveBool(CHAT_WEB_FETCH_TOOLS_ENABLED_KEY, webFetchToolsEnabled);
// Deep Research is mutually exclusive with the tool modes; clearing it here
// mirrors the other mode setters so a persisted flag cannot leave both on.
if (webFetchToolsEnabled) saveBool(CHAT_DEEP_RESEARCH_ENABLED_KEY, false);
return webFetchToolsEnabled
? { webFetchToolsEnabled, deepResearchEnabled: false }
: { webFetchToolsEnabled };
return { webFetchToolsEnabled };
}),
setRagEnabled: (ragEnabled) => set(() => ({ ragEnabled })),
setRagSource: (ragSource) =>