fix: model selection

This commit is contained in:
cynicalight 2026-04-30 10:14:55 +08:00
parent 2835426cf3
commit 9533c20d1d
2 changed files with 13 additions and 2 deletions

View File

@ -27,6 +27,7 @@ import {
OPENAI_OAUTH_DUMMY_KEY,
shouldUseOpenAICodexAuth,
} from '../openaiAuth/fetch.js'
import { isOpenAIResponsesModel } from '../openaiAuth/models.js'
import { isDebugToStdErr, logForDebugging } from '../../utils/debug.js'
import {
getAWSRegion,
@ -137,11 +138,13 @@ export async function getAnthropicClient({
await checkAndRefreshOAuthTokenIfNeeded()
logForDebugging('[API:auth] OAuth token check complete')
const isOpenAIModel = model ? isOpenAIResponsesModel(model) : false
const usingOpenAICodex =
shouldUseOpenAICodexAuth() &&
!isClaudeAISubscriber() &&
!process.env.ANTHROPIC_AUTH_TOKEN &&
!(apiKey || getAnthropicApiKey())
(isOpenAIModel ||
(!process.env.ANTHROPIC_AUTH_TOKEN &&
!(apiKey || getAnthropicApiKey())))
if (!isClaudeAISubscriber() && !usingOpenAICodex) {
await configureApiKeyHeaders(defaultHeaders, getIsNonInteractiveSession())

View File

@ -22,6 +22,12 @@ export const OPENAI_CODEX_MODEL_CATALOG: OpenAIModelCatalogEntry[] = [
description: 'Strong general-purpose model',
descriptionForModel: 'GPT-5.4 - strong general-purpose model',
},
{
value: 'gpt-5.5',
label: 'GPT-5.5',
description: 'Latest general-purpose model',
descriptionForModel: 'GPT-5.5 - latest general-purpose model',
},
{
value: OPENAI_DEFAULT_HAIKU_MODEL,
label: 'GPT-5.4 Mini',
@ -72,6 +78,8 @@ export function getOpenAIModelDisplayName(model: string): string | null {
switch (model.trim().toLowerCase()) {
case 'gpt-5.3-codex':
return 'GPT-5.3 Codex'
case 'gpt-5.5':
return 'GPT-5.5'
case 'gpt-5.4':
return 'GPT-5.4'
case 'gpt-5.4-mini':