diff --git a/src/components/CostThresholdDialog.tsx b/src/components/CostThresholdDialog.tsx index 1bb5f4ce..7c21becd 100644 --- a/src/components/CostThresholdDialog.tsx +++ b/src/components/CostThresholdDialog.tsx @@ -19,13 +19,11 @@ function getProviderLabel(): string { return 'Google Vertex' case 'foundry': return 'Azure Foundry' + case 'openai': + return 'OpenAI-compatible API' + case 'gemini': + return 'Gemini API' default: - if (process.env.CLAUDE_CODE_USE_OPENAI === '1' || process.env.CLAUDE_CODE_USE_OPENAI === 'true') { - return 'OpenAI-compatible API' - } - if (process.env.CLAUDE_CODE_USE_GEMINI === '1' || process.env.CLAUDE_CODE_USE_GEMINI === 'true') { - return 'Gemini API' - } return 'API' } } diff --git a/src/services/api/openaiShim.ts b/src/services/api/openaiShim.ts index c3b8566b..0d5bde28 100644 --- a/src/services/api/openaiShim.ts +++ b/src/services/api/openaiShim.ts @@ -259,6 +259,8 @@ function normalizeSchemaForOpenAI( // OpenAI strict mode requires every property to be listed in required[] const allKeys = Object.keys(normalizedProps) record.required = Array.from(new Set([...existingRequired, ...allKeys])) + // OpenAI strict mode requires additionalProperties: false on all object + // schemas — override unconditionally to ensure nested objects comply. record.additionalProperties = false } else { // For Gemini: keep only existing required keys that are present in properties