diff --git a/tools/ai-cli-dispatch/src/execute.ts b/tools/ai-cli-dispatch/src/execute.ts index 1524d85..56adbf4 100644 --- a/tools/ai-cli-dispatch/src/execute.ts +++ b/tools/ai-cli-dispatch/src/execute.ts @@ -6,9 +6,9 @@ import type { ClientName, ExecResult } from "./types.js"; import { ClientNotFoundError, ExecError } from "./types.js"; const CLIENT_ARGS: Record string[]> = { - codex: (p) => ["exec", p], - claude: (p) => ["-p", p], - opencode: (p) => ["run", p], + codex: (p) => ["exec", "--full-auto", p], + claude: (p) => ["-p", p, "--dangerously-skip-permissions"], + opencode: (p) => ["run", "--dangerously-skip-permissions", p], }; export interface ExecuteOptions { diff --git a/tools/ai-cli-dispatch/tests/execute.test.ts b/tools/ai-cli-dispatch/tests/execute.test.ts index 9248464..bf6882f 100644 --- a/tools/ai-cli-dispatch/tests/execute.test.ts +++ b/tools/ai-cli-dispatch/tests/execute.test.ts @@ -82,7 +82,7 @@ function mockExistsSync(allowedPaths: Set): any { describe("executePrompt", () => { it("captures stdout for a successful codex execution", async () => { const scenarios = new Map([ - ['codex exec "hello world"', { stdout: "result\n", exitCode: 0 }], + ['codex exec --full-auto "hello world"', { stdout: "result\n", exitCode: 0 }], ]); const result = await executePrompt("codex", '"hello world"', { spawn: mockSpawn(scenarios), @@ -95,7 +95,7 @@ describe("executePrompt", () => { it("captures stderr for a successful claude execution", async () => { const scenarios = new Map([ - ["claude -p hello", { stdout: "", stderr: "warning\n", exitCode: 0 }], + ["claude -p hello --dangerously-skip-permissions", { stdout: "", stderr: "warning\n", exitCode: 0 }], ]); const result = await executePrompt("claude", "hello", { spawn: mockSpawn(scenarios), @@ -108,7 +108,7 @@ describe("executePrompt", () => { it("returns non-zero exit code without throwing", async () => { const scenarios = new Map([ - ["opencode run fail", { stdout: "", stderr: "error\n", exitCode: 1 }], + ["opencode run --dangerously-skip-permissions fail", { stdout: "", stderr: "error\n", exitCode: 1 }], ]); const result = await executePrompt("opencode", "fail", { spawn: mockSpawn(scenarios), @@ -141,7 +141,7 @@ describe("executePrompt", () => { it("rejects with ExecError when timeout is exceeded", async () => { const scenarios = new Map([ - ["codex exec slow", { hang: true }], + ["codex exec --full-auto slow", { hang: true }], ]); await assert.rejects( executePrompt("codex", "slow", { @@ -159,7 +159,7 @@ describe("executePrompt", () => { it("passes prompts with special characters unchanged", async () => { const scenarios = new Map([ [ - 'codex exec "quotes\nnewlines"', + 'codex exec --full-auto "quotes\nnewlines"', { stdout: "ok", exitCode: 0 }, ], ]);