mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 09:13:08 +00:00
fix: update model resolver for codex- prefix and fix thinking/reasoning separation
- Add codex- prefix support in model resolver - Fix modelSupportsThinking() to properly detect provider types - Update CODEX_MODEL_PREFIXES to include codex- prefix
This commit is contained in:
@@ -10,12 +10,27 @@ export function cn(...inputs: ClassValue[]) {
|
|||||||
/**
|
/**
|
||||||
* Determine if the current model supports extended thinking controls
|
* Determine if the current model supports extended thinking controls
|
||||||
* Note: This is for Claude's "thinking levels" only, not Codex's "reasoning effort"
|
* Note: This is for Claude's "thinking levels" only, not Codex's "reasoning effort"
|
||||||
|
*
|
||||||
|
* Rules:
|
||||||
|
* - Claude models: support thinking (sonnet-4.5-thinking, opus-4.5-thinking, etc.)
|
||||||
|
* - Cursor models: NO thinking controls (handled internally by Cursor CLI)
|
||||||
|
* - Codex models: NO thinking controls (they use reasoningEffort instead)
|
||||||
*/
|
*/
|
||||||
export function modelSupportsThinking(_model?: ModelAlias | string): boolean {
|
export function modelSupportsThinking(_model?: ModelAlias | string): boolean {
|
||||||
if (!_model) return true;
|
if (!_model) return true;
|
||||||
|
|
||||||
// Codex models don't support Claude thinking levels - they use reasoning effort instead
|
// Cursor models - don't show thinking controls
|
||||||
if (_model.startsWith('gpt-') && _model in CODEX_MODEL_CONFIG_MAP) {
|
if (_model.startsWith('cursor-')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Codex models - use reasoningEffort, not thinkingLevel
|
||||||
|
if (_model.startsWith('codex-')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bare gpt- models (legacy) - assume Codex, no thinking controls
|
||||||
|
if (_model.startsWith('gpt-')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,13 +50,12 @@ export function getProviderFromModel(model?: string): ModelProvider {
|
|||||||
return 'cursor';
|
return 'cursor';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for Codex/OpenAI models (gpt- prefix or o-series)
|
// Check for Codex/OpenAI models (codex- prefix, gpt- prefix, or o-series)
|
||||||
const CODEX_MODEL_PREFIXES = ['gpt-'];
|
|
||||||
const OPENAI_O_SERIES_PATTERN = /^o\d/;
|
|
||||||
if (
|
if (
|
||||||
CODEX_MODEL_PREFIXES.some((prefix) => model.startsWith(prefix)) ||
|
model.startsWith('codex-') ||
|
||||||
OPENAI_O_SERIES_PATTERN.test(model) ||
|
model.startsWith('codex:') ||
|
||||||
model.startsWith('codex:')
|
model.startsWith('gpt-') ||
|
||||||
|
/^o\d/.test(model)
|
||||||
) {
|
) {
|
||||||
return 'codex';
|
return 'codex';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import {
|
|||||||
} from '@automaker/types';
|
} from '@automaker/types';
|
||||||
|
|
||||||
// Pattern definitions for Codex/OpenAI models
|
// Pattern definitions for Codex/OpenAI models
|
||||||
const CODEX_MODEL_PREFIXES = ['gpt-'];
|
const CODEX_MODEL_PREFIXES = ['codex-', 'gpt-'];
|
||||||
const OPENAI_O_SERIES_PATTERN = /^o\d/;
|
const OPENAI_O_SERIES_PATTERN = /^o\d/;
|
||||||
const OPENAI_O_SERIES_ALLOWED_MODELS = new Set<string>();
|
const OPENAI_O_SERIES_ALLOWED_MODELS = new Set<string>();
|
||||||
|
|
||||||
@@ -62,6 +62,12 @@ export function resolveModelString(
|
|||||||
return modelKey;
|
return modelKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Codex model with explicit prefix (e.g., "codex-gpt-5.1-codex-max") - pass through unchanged
|
||||||
|
if (modelKey.startsWith(PROVIDER_PREFIXES.codex)) {
|
||||||
|
console.log(`[ModelResolver] Using Codex model: ${modelKey}`);
|
||||||
|
return modelKey;
|
||||||
|
}
|
||||||
|
|
||||||
// Full Claude model string - pass through unchanged
|
// Full Claude model string - pass through unchanged
|
||||||
if (modelKey.includes('claude-')) {
|
if (modelKey.includes('claude-')) {
|
||||||
console.log(`[ModelResolver] Using full Claude model string: ${modelKey}`);
|
console.log(`[ModelResolver] Using full Claude model string: ${modelKey}`);
|
||||||
@@ -75,8 +81,7 @@ export function resolveModelString(
|
|||||||
return resolved;
|
return resolved;
|
||||||
}
|
}
|
||||||
|
|
||||||
// OpenAI/Codex models - check BEFORE bare Cursor models since they overlap
|
// OpenAI/Codex models - check for codex- or gpt- prefix
|
||||||
// (Cursor supports gpt models, but bare "gpt-*" should route to Codex)
|
|
||||||
if (
|
if (
|
||||||
CODEX_MODEL_PREFIXES.some((prefix) => modelKey.startsWith(prefix)) ||
|
CODEX_MODEL_PREFIXES.some((prefix) => modelKey.startsWith(prefix)) ||
|
||||||
(OPENAI_O_SERIES_PATTERN.test(modelKey) && OPENAI_O_SERIES_ALLOWED_MODELS.has(modelKey))
|
(OPENAI_O_SERIES_PATTERN.test(modelKey) && OPENAI_O_SERIES_ALLOWED_MODELS.has(modelKey))
|
||||||
|
|||||||
Reference in New Issue
Block a user