mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-18 13:23:33 +08:00
fix: model selection
This commit is contained in:
parent
2835426cf3
commit
9533c20d1d
@ -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())
|
||||
|
||||
@ -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':
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user