mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-22 18:24:21 +01:00
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:
@@ -150,6 +150,16 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const fallbackModel = createMemo(() => {
|
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) {
|
if (sync.data.config.model) {
|
||||||
const { providerID, modelID } = Provider.parseModel(sync.data.config.model)
|
const { providerID, modelID } = Provider.parseModel(sync.data.config.model)
|
||||||
if (isModelValid({ providerID, modelID })) {
|
if (isModelValid({ providerID, modelID })) {
|
||||||
|
|||||||
Reference in New Issue
Block a user