diff options
| author | Adam <[email protected]> | 2026-03-13 11:05:08 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-13 11:05:08 -0500 |
| commit | 4ad8116ce37a0e77e7f3c0e9e4e1002bba05b15e (patch) | |
| tree | b7e5ed2b05aabb5ed5134520c4eb485c52eb5333 /packages/app/src/context/model-variant.ts | |
| parent | 5c7088338c07ad632834ebd4a87feb23d255fb8a (diff) | |
| download | opencode-4ad8116ce37a0e77e7f3c0e9e4e1002bba05b15e.tar.gz opencode-4ad8116ce37a0e77e7f3c0e9e4e1002bba05b15e.zip | |
fix(app): model selection persist by session (#17348)
Diffstat (limited to 'packages/app/src/context/model-variant.ts')
| -rw-r--r-- | packages/app/src/context/model-variant.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/app/src/context/model-variant.ts b/packages/app/src/context/model-variant.ts index 6b7ae7256..525acbba3 100644 --- a/packages/app/src/context/model-variant.ts +++ b/packages/app/src/context/model-variant.ts @@ -14,7 +14,7 @@ type Model = AgentModel & { type VariantInput = { variants: string[] - selected: string | undefined + selected: string | null | undefined configured: string | undefined } @@ -29,6 +29,7 @@ export function getConfiguredAgentVariant(input: { agent: Agent | undefined; mod } export function resolveModelVariant(input: VariantInput) { + if (input.selected === null) return undefined if (input.selected && input.variants.includes(input.selected)) return input.selected if (input.configured && input.variants.includes(input.configured)) return input.configured return undefined @@ -36,6 +37,7 @@ export function resolveModelVariant(input: VariantInput) { export function cycleModelVariant(input: VariantInput) { if (input.variants.length === 0) return undefined + if (input.selected === null) return input.variants[0] if (input.selected && input.variants.includes(input.selected)) { const index = input.variants.indexOf(input.selected) if (index === input.variants.length - 1) return undefined |
