Fixed model selection persistence bug

Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
This commit is contained in:
opencode-agent[bot] 2025-11-13 18:01:48 +00:00
parent 73443585e5
commit f22edc15ba

View file

@ -30,10 +30,10 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
}
}
// Automatically update model when agent changes
// Automatically update model when agent changes, but only if user hasn't selected a model
createEffect(() => {
const value = agent.current()
if (value.model) {
if (value.model && !modelStore.model[value.name]) {
if (isModelValid(value.model))
model.set({
providerID: value.model.providerID,