fix: adress pr comments

This commit is contained in:
Shirone
2026-01-24 20:41:25 +01:00
parent 1b2bf0df3f
commit 43661e5a6e

View File

@@ -7,7 +7,7 @@
*/
import type { ModelProvider } from './settings.js';
import { CURSOR_MODEL_MAP, LEGACY_CURSOR_MODEL_MAP } from './cursor-models.js';
import { LEGACY_CURSOR_MODEL_MAP } from './cursor-models.js';
import { CLAUDE_MODEL_MAP, CODEX_MODEL_MAP } from './model.js';
import { OPENCODE_MODEL_CONFIG_MAP, LEGACY_OPENCODE_MODEL_MAP } from './opencode-models.js';
import { GEMINI_MODEL_MAP } from './gemini-models.js';
@@ -370,6 +370,16 @@ export function normalizeModelString(model: string | undefined | null): string {
* supportsStructuredOutput('gemini-2.5-pro') // false
*/
export function supportsStructuredOutput(model: string | undefined | null): boolean {
// Exclude proxy providers first - they may have Claude/Codex in the model name
// but route through different APIs that don't support structured output
if (
isCursorModel(model) ||
isGeminiModel(model) ||
isOpencodeModel(model) ||
isCopilotModel(model)
) {
return false;
}
return isClaudeModel(model) || isCodexModel(model);
}