fix: persist -m model when switching agents

Add initial model from command line to fallback chain so it persists
when switching agents with tab, matching behavior of config model.

Resolves #3863
This commit is contained in:
Dax Raad
2025-11-03 23:49:09 -05:00
parent f501501791
commit 9886353715

View File

@@ -150,6 +150,16 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
})
const fallbackModel = createMemo(() => {
if (props.initialModel) {
const { providerID, modelID } = Provider.parseModel(props.initialModel)
if (isModelValid({ providerID, modelID })) {
return {
providerID,
modelID,
}
}
}
if (sync.data.config.model) {
const { providerID, modelID } = Provider.parseModel(sync.data.config.model)
if (isModelValid({ providerID, modelID })) {