Skip to content

Commit 497a33d

Browse files
committed
switch model as well when switching provider
1 parent cec2fa6 commit 497a33d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/components/ProviderManager.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as React from 'react'
33
import { DEFAULT_CODEX_BASE_URL } from '../services/api/providerConfig.js'
44
import { Box, Text } from '../ink.js'
55
import { useKeybinding } from '../keybindings/useKeybinding.js'
6+
import { useSetAppState } from '../state/AppState.js'
67
import type { ProviderProfile } from '../utils/config.js'
78
import {
89
clearCodexCredentials,
@@ -580,6 +581,11 @@ export function ProviderManager({ mode, onDone }: Props): React.ReactNode {
580581
return
581582
}
582583

584+
setAppState(prev => ({
585+
...prev,
586+
mainLoopModel: GITHUB_PROVIDER_DEFAULT_MODEL,
587+
mainLoopModelForSession: null,
588+
}))
583589
refreshProfiles()
584590
setAppState(prev => ({
585591
...prev,
@@ -608,6 +614,11 @@ export function ProviderManager({ mode, onDone }: Props): React.ReactNode {
608614
}))
609615

610616
providerLabel = active.name
617+
setAppState(prev => ({
618+
...prev,
619+
mainLoopModel: active.model,
620+
mainLoopModelForSession: null,
621+
}))
611622
const settingsOverrideError =
612623
clearStartupProviderOverrideFromUserSettings()
613624
const isActiveCodexOAuth = isCodexOAuthProfile(

0 commit comments

Comments
 (0)