Fix connected chat model persistence (#5702)
This commit is contained in:
parent
b89e28a836
commit
8b235c752b
2 changed files with 1 additions and 16 deletions
|
|
@ -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,
|
||||
],
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue