[codex] fix profile scoped model selection (#881)
* fix profile scoped model selection * test profile scoped provider refresh
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user