fix: add codex-cli case to useSelectedModel hook

This commit is contained in:
Roo Code 2025-09-17 01:30:22 +00:00
parent d50567ffbd
commit a5d010e998

View file

@ -36,6 +36,8 @@ import {
litellmDefaultModelId,
claudeCodeDefaultModelId,
claudeCodeModels,
codexCliDefaultModelId,
codexCliModels,
sambaNovaModels,
sambaNovaDefaultModelId,
doubaoModels,
@ -343,6 +345,12 @@ function getSelectedModel({
const info = qwenCodeModels[id as keyof typeof qwenCodeModels]
return { id, info }
}
case "codex-cli": {
// Codex CLI models are OpenAI-compatible
const id = apiConfiguration.apiModelId ?? codexCliDefaultModelId
const info = codexCliModels[id as keyof typeof codexCliModels]
return { id, info: { ...openAiModelInfoSaneDefaults, ...info } }
}
case "vercel-ai-gateway": {
const id = apiConfiguration.vercelAiGatewayModelId ?? vercelAiGatewayDefaultModelId
const info = routerModels["vercel-ai-gateway"]?.[id]
@ -352,7 +360,7 @@ function getSelectedModel({
// case "human-relay":
// case "fake-ai":
default: {
provider satisfies "anthropic" | "gemini-cli" | "qwen-code" | "human-relay" | "fake-ai"
provider satisfies "anthropic" | "gemini-cli" | "human-relay" | "fake-ai"
const id = apiConfiguration.apiModelId ?? anthropicDefaultModelId
const baseInfo = anthropicModels[id as keyof typeof anthropicModels]