Fix connected chat model persistence (#5702)

This commit is contained in:
Wasim Yousef Said 2026-05-22 16:20:24 +02:00 committed by GitHub
commit 8b235c752b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 16 deletions

View file

@ -993,10 +993,7 @@ export function ChatPage(): ReactElement {
const stillOnOpenRouterFree =
selectedProvider?.providerType === "openrouter" &&
selectedExternal?.modelId === "openrouter/free";
setInferenceParams({
...store.params,
checkpoint: value,
});
store.setCheckpoint(value, null);
const supportsBuiltinWebSearch = providerSupportsBuiltinWebSearch(
selectedProvider?.providerType,
);
@ -1117,7 +1114,6 @@ export function ChatPage(): ReactElement {
externalProvidersForChat,
modelsFromStore,
selectModel,
setInferenceParams,
view,
],
);

View file

@ -640,17 +640,6 @@ export const useChatRuntimeStore = create<ChatRuntimeStore>((set, get) => ({
if (state.settingsHydrated && hasKeys(changedParams)) {
saveSettingsPatch({ inferenceParams: changedParams });
}
// chat-page picks an external model by mutating `params.checkpoint`
// through this setter (not through `setCheckpoint`), so the
// localStorage mirror needs to be refreshed here too. Otherwise
// the persisted slot stays empty and a refresh falls back to
// whatever the backend's `/api/inference/status.active_model`
// returns -- usually the previously loaded local model.
if (params.checkpoint !== state.params.checkpoint) {
saveLastExternalCheckpoint(
isExternalModelId(params.checkpoint) ? params.checkpoint : null,
);
}
return { params };
}),
setCustomPresets: (customPresets) =>