[codex] fix profile scoped model selection (#881)

* fix profile scoped model selection

* test profile scoped provider refresh
This commit is contained in:
ekko
2026-05-20 18:26:01 +08:00
committed by GitHub
parent cd77e5ba2e
commit 40109e9c42
18 changed files with 119 additions and 26 deletions
@@ -15,11 +15,10 @@ const collapsedGroups = ref<Record<string, boolean>>({})
const customInput = ref('')
const customProvider = ref('')
const selectedDisplayName = computed(() => appStore.displayModelName(appStore.selectedModel, appStore.selectedProvider))
const activeProfileName = computed(() => profilesStore.activeProfileName || 'default')
const activeModelGroups = computed(() => {
const profileModels = appStore.profileModelGroups.find(entry => entry.profile === activeProfileName.value)
return profileModels?.groups?.length ? profileModels.groups : appStore.modelGroups
return profileModels?.groups || []
})
const providerOptions = computed(() => {
@@ -38,6 +37,18 @@ const modelGroupsWithCustom = computed(() =>
}))
)
const selectedModelInActiveProfile = computed(() =>
modelGroupsWithCustom.value.some(group =>
group.provider === appStore.selectedProvider && group.models.includes(appStore.selectedModel),
),
)
const selectedDisplayName = computed(() =>
selectedModelInActiveProfile.value
? appStore.displayModelName(appStore.selectedModel, appStore.selectedProvider)
: '',
)
function isCustomModel(model: string, provider: string) {
return (appStore.customModels[provider] || []).includes(model)
}