diff options
| author | Dax Raad <[email protected]> | 2025-11-03 23:49:09 -0500 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-11-03 23:51:52 -0500 |
| commit | 9886353715e3fc0586b879dd36a500ebc3b2241d (patch) | |
| tree | e51b5e310ccd0f77ce3bac3e72fa098a7cfd5d24 | |
| parent | f5015017911c81c6d89d0a3dcdbe475b948c6829 (diff) | |
| download | opencode-9886353715e3fc0586b879dd36a500ebc3b2241d.tar.gz opencode-9886353715e3fc0586b879dd36a500ebc3b2241d.zip | |
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
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/context/local.tsx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/context/local.tsx b/packages/opencode/src/cli/cmd/tui/context/local.tsx index 69e731769..ef26ee656 100644 --- a/packages/opencode/src/cli/cmd/tui/context/local.tsx +++ b/packages/opencode/src/cli/cmd/tui/context/local.tsx @@ -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 })) { |
