mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
fix: differentiate Codex CLI models from Cursor CLI models
- Fix isCursorModel to exclude Codex-specific models (gpt-5.1-codex-*, gpt-5.2-codex-*) - These models should route to Codex provider, not Cursor provider - Add CODEX_YOLO_FLAG constant for --dangerously-bypass-approvals-and-sandbox - Always use YOLO flag in codex-provider for full permissions - Simplify codex CLI args to minimal set with YOLO flag - Update tests to reflect new behavior with YOLO flag This fixes the bug where selecting a Codex model (e.g., gpt-5.1-codex-max) was incorrectly spawning cursor-agent instead of codex exec. The root cause was: 1. Cursor provider had higher priority (10) than Codex (5) 2. isCursorModel() returned true for Codex models in CURSOR_MODEL_MAP 3. Models like gpt-5.1-codex-max routed to Cursor instead of Codex The fix: 1. isCursorModel now excludes Codex-specific model IDs 2. Codex always uses --dangerously-bypass-approvals-and-sandbox flag
This commit is contained in:
@@ -61,6 +61,7 @@ const CODEX_ADD_DIR_FLAG = '--add-dir';
|
||||
const CODEX_SKIP_GIT_REPO_CHECK_FLAG = '--skip-git-repo-check';
|
||||
const CODEX_RESUME_FLAG = 'resume';
|
||||
const CODEX_REASONING_EFFORT_KEY = 'reasoning_effort';
|
||||
const CODEX_YOLO_FLAG = '--dangerously-bypass-approvals-and-sandbox';
|
||||
const OPENAI_API_KEY_ENV = 'OPENAI_API_KEY';
|
||||
const CODEX_EXECUTION_MODE_CLI = 'cli';
|
||||
const CODEX_EXECUTION_MODE_SDK = 'sdk';
|
||||
@@ -761,16 +762,12 @@ export class CodexProvider extends BaseProvider {
|
||||
|
||||
const args = [
|
||||
CODEX_EXEC_SUBCOMMAND,
|
||||
CODEX_YOLO_FLAG,
|
||||
CODEX_SKIP_GIT_REPO_CHECK_FLAG,
|
||||
...preExecArgs,
|
||||
CODEX_MODEL_FLAG,
|
||||
options.model,
|
||||
CODEX_JSON_FLAG,
|
||||
CODEX_SANDBOX_FLAG,
|
||||
resolvedSandboxMode,
|
||||
...(outputSchemaPath ? [CODEX_OUTPUT_SCHEMA_FLAG, outputSchemaPath] : []),
|
||||
...(imagePaths.length > 0 ? [CODEX_IMAGE_FLAG, imagePaths.join(',')] : []),
|
||||
...configOverrides,
|
||||
'-', // Read prompt from stdin to avoid shell escaping issues
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user