From 22175843e2e708000a45d0477fa65dffc4b5a5b0 Mon Sep 17 00:00:00 2001 From: "kiloconnect[bot]" <240665456+kiloconnect[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 16:20:15 +0000 Subject: [PATCH] fix(cli): use variable for binary name in pr.ts to minimize upstream diff Address review feedback from @lambertjosh: keep the original opencodeArgs/opencodeProcess variable names from upstream since they are not user-facing. Introduce a 'bin' variable to change only the spawned command, minimizing the diff and reducing merge conflicts. --- packages/opencode/src/cli/cmd/pr.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/opencode/src/cli/cmd/pr.ts b/packages/opencode/src/cli/cmd/pr.ts index 43504be093a..7b344a1beb8 100644 --- a/packages/opencode/src/cli/cmd/pr.ts +++ b/packages/opencode/src/cli/cmd/pr.ts @@ -91,26 +91,27 @@ export const PrCommand = cmd({ UI.println(`Successfully checked out PR #${prNumber} as branch '${localBranchName}'`) UI.println() // kilocode_change start - UI.println("Starting kilo...") + const bin = "kilo" + // kilocode_change end + UI.println(`Starting ${bin}...`) // kilocode_change UI.println() - // Launch kilo TUI with session ID if available + // Launch opencode TUI with session ID if available const { spawn } = await import("child_process") - const flags = sessionId ? ["-s", sessionId] : [] - const child = spawn("kilo", flags, { + const opencodeArgs = sessionId ? ["-s", sessionId] : [] + const opencodeProcess = spawn(bin, opencodeArgs, { // kilocode_change stdio: "inherit", cwd: process.cwd(), - windowsHide: true, + windowsHide: true, // kilocode_change - prevent CMD window flash on Windows }) await new Promise((resolve, reject) => { - child.on("exit", (code) => { + opencodeProcess.on("exit", (code) => { if (code === 0) resolve() - else reject(new Error(`kilo exited with code ${code}`)) + else reject(new Error(`${bin} exited with code ${code}`)) // kilocode_change }) - child.on("error", reject) + opencodeProcess.on("error", reject) }) - // kilocode_change end }, }) },