mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
fix: add provider prefixes to CLI models for clear separation
- Add 'codex-' prefix to all Codex CLI model IDs - Add 'cursor-' prefix to Cursor CLI GPT model IDs - Update provider-utils.ts to use prefix-based matching - Update UI components to use prefixed model IDs - Fix model routing to prevent Cursor picking up Codex models
This commit is contained in:
@@ -2,13 +2,15 @@
|
||||
* Codex CLI Model IDs
|
||||
* Based on OpenAI Codex CLI official models
|
||||
* Reference: https://developers.openai.com/codex/models/
|
||||
*
|
||||
* IMPORTANT: All Codex models use 'codex-' prefix to distinguish from Cursor CLI models
|
||||
*/
|
||||
export type CodexModelId =
|
||||
| 'gpt-5.2-codex'
|
||||
| 'gpt-5.1-codex-max'
|
||||
| 'gpt-5.1-codex-mini'
|
||||
| 'gpt-5.2'
|
||||
| 'gpt-5.1';
|
||||
| 'codex-gpt-5.2-codex'
|
||||
| 'codex-gpt-5.1-codex-max'
|
||||
| 'codex-gpt-5.1-codex-mini'
|
||||
| 'codex-gpt-5.2'
|
||||
| 'codex-gpt-5.1';
|
||||
|
||||
/**
|
||||
* Codex model metadata
|
||||
@@ -24,40 +26,41 @@ export interface CodexModelConfig {
|
||||
|
||||
/**
|
||||
* Complete model map for Codex CLI
|
||||
* All keys use 'codex-' prefix to distinguish from Cursor CLI models
|
||||
*/
|
||||
export const CODEX_MODEL_CONFIG_MAP: Record<CodexModelId, CodexModelConfig> = {
|
||||
'gpt-5.2-codex': {
|
||||
id: 'gpt-5.2-codex',
|
||||
'codex-gpt-5.2-codex': {
|
||||
id: 'codex-gpt-5.2-codex',
|
||||
label: 'GPT-5.2-Codex',
|
||||
description: 'Most advanced agentic coding model for complex software engineering',
|
||||
hasThinking: true,
|
||||
supportsVision: true,
|
||||
},
|
||||
'gpt-5.1-codex-max': {
|
||||
id: 'gpt-5.1-codex-max',
|
||||
'codex-gpt-5.1-codex-max': {
|
||||
id: 'codex-gpt-5.1-codex-max',
|
||||
label: 'GPT-5.1-Codex-Max',
|
||||
description: 'Optimized for long-horizon, agentic coding tasks in Codex',
|
||||
hasThinking: true,
|
||||
supportsVision: true,
|
||||
},
|
||||
'gpt-5.1-codex-mini': {
|
||||
id: 'gpt-5.1-codex-mini',
|
||||
'codex-gpt-5.1-codex-mini': {
|
||||
id: 'codex-gpt-5.1-codex-mini',
|
||||
label: 'GPT-5.1-Codex-Mini',
|
||||
description: 'Smaller, more cost-effective version for faster workflows',
|
||||
hasThinking: false,
|
||||
supportsVision: true,
|
||||
},
|
||||
'gpt-5.2': {
|
||||
id: 'gpt-5.2',
|
||||
label: 'GPT-5.2',
|
||||
description: 'Best general agentic model for tasks across industries and domains',
|
||||
'codex-gpt-5.2': {
|
||||
id: 'codex-gpt-5.2',
|
||||
label: 'GPT-5.2 (Codex)',
|
||||
description: 'Best general agentic model for tasks across industries and domains via Codex',
|
||||
hasThinking: true,
|
||||
supportsVision: true,
|
||||
},
|
||||
'gpt-5.1': {
|
||||
id: 'gpt-5.1',
|
||||
label: 'GPT-5.1',
|
||||
description: 'Great for coding and agentic tasks across domains',
|
||||
'codex-gpt-5.1': {
|
||||
id: 'codex-gpt-5.1',
|
||||
label: 'GPT-5.1 (Codex)',
|
||||
description: 'Great for coding and agentic tasks across domains via Codex',
|
||||
hasThinking: true,
|
||||
supportsVision: true,
|
||||
},
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* Cursor CLI Model IDs
|
||||
* Reference: https://cursor.com/docs
|
||||
*
|
||||
* IMPORTANT: GPT models use 'cursor-' prefix to distinguish from Codex CLI models
|
||||
*/
|
||||
export type CursorModelId =
|
||||
| 'auto' // Auto-select best model
|
||||
@@ -12,14 +14,14 @@ export type CursorModelId =
|
||||
| 'opus-4.1' // Claude Opus 4.1
|
||||
| 'gemini-3-pro' // Gemini 3 Pro
|
||||
| 'gemini-3-flash' // Gemini 3 Flash
|
||||
| 'gpt-5.2' // GPT-5.2
|
||||
| 'gpt-5.1' // GPT-5.1
|
||||
| 'gpt-5.2-high' // GPT-5.2 High
|
||||
| 'gpt-5.1-high' // GPT-5.1 High
|
||||
| 'gpt-5.1-codex' // GPT-5.1 Codex
|
||||
| 'gpt-5.1-codex-high' // GPT-5.1 Codex High
|
||||
| 'gpt-5.1-codex-max' // GPT-5.1 Codex Max
|
||||
| 'gpt-5.1-codex-max-high' // GPT-5.1 Codex Max High
|
||||
| 'cursor-gpt-5.2' // GPT-5.2 via Cursor
|
||||
| 'cursor-gpt-5.1' // GPT-5.1 via Cursor
|
||||
| 'cursor-gpt-5.2-high' // GPT-5.2 High via Cursor
|
||||
| 'cursor-gpt-5.1-high' // GPT-5.1 High via Cursor
|
||||
| 'cursor-gpt-5.1-codex' // GPT-5.1 Codex via Cursor
|
||||
| 'cursor-gpt-5.1-codex-high' // GPT-5.1 Codex High via Cursor
|
||||
| 'cursor-gpt-5.1-codex-max' // GPT-5.1 Codex Max via Cursor
|
||||
| 'cursor-gpt-5.1-codex-max-high' // GPT-5.1 Codex Max High via Cursor
|
||||
| 'grok'; // Grok
|
||||
|
||||
/**
|
||||
@@ -101,57 +103,57 @@ export const CURSOR_MODEL_MAP: Record<CursorModelId, CursorModelConfig> = {
|
||||
hasThinking: false,
|
||||
supportsVision: false,
|
||||
},
|
||||
'gpt-5.2': {
|
||||
id: 'gpt-5.2',
|
||||
'cursor-gpt-5.2': {
|
||||
id: 'cursor-gpt-5.2',
|
||||
label: 'GPT-5.2',
|
||||
description: 'OpenAI GPT-5.2 via Cursor',
|
||||
hasThinking: false,
|
||||
supportsVision: false,
|
||||
},
|
||||
'gpt-5.1': {
|
||||
id: 'gpt-5.1',
|
||||
'cursor-gpt-5.1': {
|
||||
id: 'cursor-gpt-5.1',
|
||||
label: 'GPT-5.1',
|
||||
description: 'OpenAI GPT-5.1 via Cursor',
|
||||
hasThinking: false,
|
||||
supportsVision: false,
|
||||
},
|
||||
'gpt-5.2-high': {
|
||||
id: 'gpt-5.2-high',
|
||||
'cursor-gpt-5.2-high': {
|
||||
id: 'cursor-gpt-5.2-high',
|
||||
label: 'GPT-5.2 High',
|
||||
description: 'OpenAI GPT-5.2 with high compute',
|
||||
hasThinking: false,
|
||||
supportsVision: false,
|
||||
},
|
||||
'gpt-5.1-high': {
|
||||
id: 'gpt-5.1-high',
|
||||
'cursor-gpt-5.1-high': {
|
||||
id: 'cursor-gpt-5.1-high',
|
||||
label: 'GPT-5.1 High',
|
||||
description: 'OpenAI GPT-5.1 with high compute',
|
||||
hasThinking: false,
|
||||
supportsVision: false,
|
||||
},
|
||||
'gpt-5.1-codex': {
|
||||
id: 'gpt-5.1-codex',
|
||||
'cursor-gpt-5.1-codex': {
|
||||
id: 'cursor-gpt-5.1-codex',
|
||||
label: 'GPT-5.1 Codex',
|
||||
description: 'OpenAI GPT-5.1 Codex for code generation',
|
||||
hasThinking: false,
|
||||
supportsVision: false,
|
||||
},
|
||||
'gpt-5.1-codex-high': {
|
||||
id: 'gpt-5.1-codex-high',
|
||||
'cursor-gpt-5.1-codex-high': {
|
||||
id: 'cursor-gpt-5.1-codex-high',
|
||||
label: 'GPT-5.1 Codex High',
|
||||
description: 'OpenAI GPT-5.1 Codex with high compute',
|
||||
hasThinking: false,
|
||||
supportsVision: false,
|
||||
},
|
||||
'gpt-5.1-codex-max': {
|
||||
id: 'gpt-5.1-codex-max',
|
||||
'cursor-gpt-5.1-codex-max': {
|
||||
id: 'cursor-gpt-5.1-codex-max',
|
||||
label: 'GPT-5.1 Codex Max',
|
||||
description: 'OpenAI GPT-5.1 Codex Max capacity',
|
||||
hasThinking: false,
|
||||
supportsVision: false,
|
||||
},
|
||||
'gpt-5.1-codex-max-high': {
|
||||
id: 'gpt-5.1-codex-max-high',
|
||||
'cursor-gpt-5.1-codex-max-high': {
|
||||
id: 'cursor-gpt-5.1-codex-max-high',
|
||||
label: 'GPT-5.1 Codex Max High',
|
||||
description: 'OpenAI GPT-5.1 Codex Max with high compute',
|
||||
hasThinking: false,
|
||||
@@ -224,14 +226,14 @@ export interface GroupedModel {
|
||||
export const CURSOR_MODEL_GROUPS: GroupedModel[] = [
|
||||
// GPT-5.2 group (compute levels)
|
||||
{
|
||||
baseId: 'gpt-5.2-group',
|
||||
baseId: 'cursor-gpt-5.2-group',
|
||||
label: 'GPT-5.2',
|
||||
description: 'OpenAI GPT-5.2 via Cursor',
|
||||
variantType: 'compute',
|
||||
variants: [
|
||||
{ id: 'gpt-5.2', label: 'Standard', description: 'Default compute level' },
|
||||
{ id: 'cursor-gpt-5.2', label: 'Standard', description: 'Default compute level' },
|
||||
{
|
||||
id: 'gpt-5.2-high',
|
||||
id: 'cursor-gpt-5.2-high',
|
||||
label: 'High',
|
||||
description: 'High compute level',
|
||||
badge: 'More tokens',
|
||||
@@ -240,14 +242,14 @@ export const CURSOR_MODEL_GROUPS: GroupedModel[] = [
|
||||
},
|
||||
// GPT-5.1 group (compute levels)
|
||||
{
|
||||
baseId: 'gpt-5.1-group',
|
||||
baseId: 'cursor-gpt-5.1-group',
|
||||
label: 'GPT-5.1',
|
||||
description: 'OpenAI GPT-5.1 via Cursor',
|
||||
variantType: 'compute',
|
||||
variants: [
|
||||
{ id: 'gpt-5.1', label: 'Standard', description: 'Default compute level' },
|
||||
{ id: 'cursor-gpt-5.1', label: 'Standard', description: 'Default compute level' },
|
||||
{
|
||||
id: 'gpt-5.1-high',
|
||||
id: 'cursor-gpt-5.1-high',
|
||||
label: 'High',
|
||||
description: 'High compute level',
|
||||
badge: 'More tokens',
|
||||
@@ -256,16 +258,26 @@ export const CURSOR_MODEL_GROUPS: GroupedModel[] = [
|
||||
},
|
||||
// GPT-5.1 Codex group (capacity + compute matrix)
|
||||
{
|
||||
baseId: 'gpt-5.1-codex-group',
|
||||
baseId: 'cursor-gpt-5.1-codex-group',
|
||||
label: 'GPT-5.1 Codex',
|
||||
description: 'OpenAI GPT-5.1 Codex for code generation',
|
||||
variantType: 'capacity',
|
||||
variants: [
|
||||
{ id: 'gpt-5.1-codex', label: 'Standard', description: 'Default capacity' },
|
||||
{ id: 'gpt-5.1-codex-high', label: 'High', description: 'High compute', badge: 'Compute' },
|
||||
{ id: 'gpt-5.1-codex-max', label: 'Max', description: 'Maximum capacity', badge: 'Capacity' },
|
||||
{ id: 'cursor-gpt-5.1-codex', label: 'Standard', description: 'Default capacity' },
|
||||
{
|
||||
id: 'gpt-5.1-codex-max-high',
|
||||
id: 'cursor-gpt-5.1-codex-high',
|
||||
label: 'High',
|
||||
description: 'High compute',
|
||||
badge: 'Compute',
|
||||
},
|
||||
{
|
||||
id: 'cursor-gpt-5.1-codex-max',
|
||||
label: 'Max',
|
||||
description: 'Maximum capacity',
|
||||
badge: 'Capacity',
|
||||
},
|
||||
{
|
||||
id: 'cursor-gpt-5.1-codex-max-high',
|
||||
label: 'Max High',
|
||||
description: 'Max capacity + high compute',
|
||||
badge: 'Premium',
|
||||
|
||||
@@ -11,21 +11,23 @@ export const CLAUDE_MODEL_MAP: Record<string, string> = {
|
||||
* Codex/OpenAI model identifiers
|
||||
* Based on OpenAI Codex CLI official models
|
||||
* See: https://developers.openai.com/codex/models/
|
||||
*
|
||||
* IMPORTANT: All Codex models use 'codex-' prefix to distinguish from Cursor CLI models
|
||||
*/
|
||||
export const CODEX_MODEL_MAP = {
|
||||
// Recommended Codex-specific models
|
||||
/** Most advanced agentic coding model for complex software engineering (default for ChatGPT users) */
|
||||
gpt52Codex: 'gpt-5.2-codex',
|
||||
gpt52Codex: 'codex-gpt-5.2-codex',
|
||||
/** Optimized for long-horizon, agentic coding tasks in Codex */
|
||||
gpt51CodexMax: 'gpt-5.1-codex-max',
|
||||
gpt51CodexMax: 'codex-gpt-5.1-codex-max',
|
||||
/** Smaller, more cost-effective version for faster workflows */
|
||||
gpt51CodexMini: 'gpt-5.1-codex-mini',
|
||||
gpt51CodexMini: 'codex-gpt-5.1-codex-mini',
|
||||
|
||||
// General-purpose GPT models (also available in Codex)
|
||||
/** Best general agentic model for tasks across industries and domains */
|
||||
gpt52: 'gpt-5.2',
|
||||
gpt52: 'codex-gpt-5.2',
|
||||
/** Great for coding and agentic tasks across domains */
|
||||
gpt51: 'gpt-5.1',
|
||||
gpt51: 'codex-gpt-5.1',
|
||||
} as const;
|
||||
|
||||
export const CODEX_MODEL_IDS = Object.values(CODEX_MODEL_MAP);
|
||||
|
||||
@@ -15,7 +15,6 @@ import { CODEX_MODEL_CONFIG_MAP, type CodexModelId } from './codex-models.js';
|
||||
export const PROVIDER_PREFIXES = {
|
||||
cursor: 'cursor-',
|
||||
codex: 'codex-',
|
||||
// Add new provider prefixes here
|
||||
} as const;
|
||||
|
||||
/**
|
||||
@@ -35,20 +34,6 @@ export function isCursorModel(model: string | undefined | null): boolean {
|
||||
// Check if it's a bare Cursor model ID (excluding Codex-specific models)
|
||||
// Codex-specific models should always route to Codex provider, not Cursor
|
||||
if (model in CURSOR_MODEL_MAP) {
|
||||
// Exclude Codex-specific model IDs that are in Cursor's model map
|
||||
// These models should be routed to Codex provider instead
|
||||
// This includes all Codex model variants (standard, high, max, mini, etc.)
|
||||
if (
|
||||
model.startsWith('gpt-5.1-codex-') ||
|
||||
model.startsWith('gpt-5.2-codex-') ||
|
||||
// Also exclude bare Codex models that overlap with Cursor's OpenAI models
|
||||
model === 'gpt-5.2' ||
|
||||
model === 'gpt-5.1' ||
|
||||
// Exclude all Codex models from CODEX_MODEL_CONFIG_MAP
|
||||
model in CODEX_MODEL_CONFIG_MAP
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -87,7 +72,7 @@ export function isCodexModel(model: string | undefined | null): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if it's a gpt- model
|
||||
// Check if it's a gpt- model (bare gpt models go to Codex, not Cursor)
|
||||
if (model.startsWith('gpt-')) {
|
||||
return true;
|
||||
}
|
||||
@@ -98,8 +83,7 @@ export function isCodexModel(model: string | undefined | null): boolean {
|
||||
}
|
||||
|
||||
// Check if it's in the CODEX_MODEL_MAP
|
||||
const modelValues = Object.values(CODEX_MODEL_MAP);
|
||||
return modelValues.includes(model as CodexModelId);
|
||||
return model in CODEX_MODEL_MAP;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -198,9 +182,8 @@ export function normalizeModelString(model: string | undefined | null): string {
|
||||
}
|
||||
|
||||
// For Codex, bare gpt-* and o-series models are valid canonical forms
|
||||
// Only add prefix if it's in CODEX_MODEL_MAP but doesn't have gpt-/o prefix
|
||||
const codexModelValues = Object.values(CODEX_MODEL_MAP);
|
||||
if (codexModelValues.includes(model as CodexModelId)) {
|
||||
// Check if it's in the CODEX_MODEL_MAP
|
||||
if (model in CODEX_MODEL_MAP) {
|
||||
// If it already starts with gpt- or o, it's canonical
|
||||
if (model.startsWith('gpt-') || /^o\d/.test(model)) {
|
||||
return model;
|
||||
|
||||
@@ -281,7 +281,7 @@ export function profileHasThinking(profile: AIProfile): boolean {
|
||||
|
||||
if (profile.provider === 'codex') {
|
||||
// Codex models handle thinking internally (o-series models)
|
||||
const model = profile.codexModel || 'gpt-5.2';
|
||||
const model = profile.codexModel || 'codex-gpt-5.2';
|
||||
return model.startsWith('o');
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ export function getProfileModelString(profile: AIProfile): string {
|
||||
}
|
||||
|
||||
if (profile.provider === 'codex') {
|
||||
return `codex:${profile.codexModel || 'gpt-5.2'}`;
|
||||
return `codex:${profile.codexModel || 'codex-gpt-5.2'}`;
|
||||
}
|
||||
|
||||
// Claude
|
||||
|
||||
Reference in New Issue
Block a user