fix: address PR review issues for Azure Codex integration

This commit is contained in:
YanZhiwei 2026-04-12 21:12:53 +08:00
parent 8afccf81c0
commit fff08ee545
2 changed files with 8 additions and 2 deletions

View File

@ -105,7 +105,13 @@ export function resolveAzureOpenAIDeployment(model: string): string {
const codex = resolveCodexDeployment(trimmed) const codex = resolveCodexDeployment(trimmed)
if (codex) { if (codex) {
if (codex === trimmed || codex.toLowerCase().includes('codex')) { const codexLower = codex.toLowerCase()
if (
codex === trimmed ||
codexLower === 'gpt-5.2-codex' ||
codexLower === 'gpt-5.3-codex' ||
codexLower === 'gpt-5.4-codex'
) {
throw new Error( throw new Error(
`Missing Azure OpenAI deployment mapping for ${trimmed}. Set AZURE_OPENAI_CODEX_DEPLOYMENT or settings.modelOverrides["${trimmed}"] to your deployment name.`, `Missing Azure OpenAI deployment mapping for ${trimmed}. Set AZURE_OPENAI_CODEX_DEPLOYMENT or settings.modelOverrides["${trimmed}"] to your deployment name.`,
) )

View File

@ -1028,7 +1028,7 @@ async function* queryModel(
> { > {
if (getAPIProvider() === 'azureOpenAI') { if (getAPIProvider() === 'azureOpenAI') {
try { try {
const systemText = systemPrompt.join('\\n') const systemText = systemPrompt.join('\n')
const maxOutputTokens = const maxOutputTokens =
options.maxOutputTokensOverride ?? options.maxOutputTokensOverride ??
getModelMaxOutputTokens(options.model).default getModelMaxOutputTokens(options.model).default