Studio: also persist external checkpoint when picker calls setParams (#5700)
The first pass only wired the localStorage mirror into `setCheckpoint`,
but the main chat-page picker actually selects an external model by
calling `setParams({ ...store.params, checkpoint: value })`. That path
never hit `setCheckpoint`, so the persisted slot stayed empty and a
refresh fell back to whatever `/api/inference/status.active_model`
returned -- the previously loaded local model (Qwen3.5 etc) or null
("Select model") when nothing was loaded locally.
Mirror the persistence in `setParams` whenever the checkpoint changes
so every entry point converges on the same behavior. `setCheckpoint`
still does it directly so the load path (compare, GGUF auto-load,
gemma fallback in chat-adapter) keeps working.
This commit is contained in:
parent
51736a7766
commit
9d3ad3ba12
1 changed files with 11 additions and 0 deletions
|
|
@ -627,6 +627,17 @@ 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