From d3aa92be0d3875b7128806c32e189044c90bb29c Mon Sep 17 00:00:00 2001 From: Stefano Fiorini Date: Mon, 18 May 2026 19:06:34 -0500 Subject: [PATCH] fix: use 'opencode run' instead of bare prompt for OpenCode client --- tools/ai-cli-dispatch/src/execute.ts | 2 +- tools/ai-cli-dispatch/tests/execute.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ai-cli-dispatch/src/execute.ts b/tools/ai-cli-dispatch/src/execute.ts index a9c5b83..1524d85 100644 --- a/tools/ai-cli-dispatch/src/execute.ts +++ b/tools/ai-cli-dispatch/src/execute.ts @@ -8,7 +8,7 @@ import { ClientNotFoundError, ExecError } from "./types.js"; const CLIENT_ARGS: Record string[]> = { codex: (p) => ["exec", p], claude: (p) => ["-p", p], - opencode: (p) => [p], + opencode: (p) => ["run", 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 eca32d3..9248464 100644 --- a/tools/ai-cli-dispatch/tests/execute.test.ts +++ b/tools/ai-cli-dispatch/tests/execute.test.ts @@ -108,7 +108,7 @@ describe("executePrompt", () => { it("returns non-zero exit code without throwing", async () => { const scenarios = new Map([ - ["opencode fail", { stdout: "", stderr: "error\n", exitCode: 1 }], + ["opencode run fail", { stdout: "", stderr: "error\n", exitCode: 1 }], ]); const result = await executePrompt("opencode", "fail", { spawn: mockSpawn(scenarios),