From 19597a20679551c169526d3dd020ac6c340f9e82 Mon Sep 17 00:00:00 2001 From: James Feng <47167674+GhostDragon124@users.noreply.github.com> Date: Mon, 1 Jun 2026 23:54:46 +0800 Subject: [PATCH] fix: add missing chatgptModels.ts, xhigh type support, and tsconfig fixes --- src/commands/effort/effort.tsx | 2 +- src/entrypoints/sdk/runtimeTypes.ts | 2 +- src/utils/model/chatgptModels.ts | 54 +++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 src/utils/model/chatgptModels.ts diff --git a/src/commands/effort/effort.tsx b/src/commands/effort/effort.tsx index 11d0d03be..89d2c7fd2 100644 --- a/src/commands/effort/effort.tsx +++ b/src/commands/effort/effort.tsx @@ -169,7 +169,7 @@ export async function call( if (COMMON_HELP_ARGS.includes(args)) { onDone( - 'Usage: /effort [low|medium|high|max|auto]\n\nEffort levels:\n- low: Quick, straightforward implementation\n- medium: Balanced approach with standard testing\n- high: Comprehensive implementation with extensive testing\n- max: Maximum capability with deepest reasoning\n- auto: Use the default effort level for your model', + 'Usage: /effort [low|medium|high|max|xhigh|auto]\\n\\nEffort levels:\\n- low: Quick, straightforward implementation\\n- medium: Balanced approach with standard testing\\n- high: Comprehensive implementation with extensive testing\\n- xhigh: Extended reasoning beyond high\\n- max: Maximum capability with deepest reasoning\\n- auto: Use the default effort level for your model', ) return } diff --git a/src/entrypoints/sdk/runtimeTypes.ts b/src/entrypoints/sdk/runtimeTypes.ts index 212c06e8b..a3f5d02ef 100644 --- a/src/entrypoints/sdk/runtimeTypes.ts +++ b/src/entrypoints/sdk/runtimeTypes.ts @@ -60,4 +60,4 @@ export interface Query { export interface InternalQuery extends Query { [key: string]: unknown } -export type EffortLevel = 'low' | 'medium' | 'high' | 'max'; +export type EffortLevel = 'low' | 'medium' | 'high' | 'max' | 'xhigh'; diff --git a/src/utils/model/chatgptModels.ts b/src/utils/model/chatgptModels.ts new file mode 100644 index 000000000..4521b9ebf --- /dev/null +++ b/src/utils/model/chatgptModels.ts @@ -0,0 +1,54 @@ +export type ChatGPTCodexModelOption = { + value: string + label: string + description: string +} + +export const CHATGPT_CODEX_DEFAULT_MODEL = 'gpt-5.5' +export const CHATGPT_CODEX_FAST_MODEL = 'gpt-5.4-mini' + +export const CHATGPT_CODEX_MODEL_OPTIONS: ChatGPTCodexModelOption[] = [ + { + value: 'gpt-5.5', + label: 'GPT-5.5', + description: + 'Frontier model for complex coding, research, and real-world work', + }, + { + value: 'gpt-5.4', + label: 'GPT-5.4', + description: 'Strong model for everyday coding', + }, + { + value: 'gpt-5.4-mini', + label: 'GPT-5.4-Mini', + description: + 'Small, fast, and cost-efficient model for simpler coding tasks', + }, + { + value: 'gpt-5.3-codex', + label: 'GPT-5.3-Codex', + description: 'Coding-optimized model', + }, + { + value: 'gpt-5.3-codex-spark', + label: 'GPT-5.3-Codex-Spark', + description: 'Ultra-fast coding model', + }, + { + value: 'gpt-5.2', + label: 'GPT-5.2', + description: 'Optimized for professional work and long-running agents', + }, +] + +export function isChatGPTAuthMode(): boolean { + return process.env.OPENAI_AUTH_MODE === 'chatgpt' +} + +export function isChatGPTCodexReasoningModel(model: string): boolean { + const normalized = model.toLowerCase().replace(/\[1m\]$/, '') + return CHATGPT_CODEX_MODEL_OPTIONS.some( + option => option.value.toLowerCase() === normalized, + ) +}