From df7404baec7627e23ffa7c92ef3602fe05671e6c Mon Sep 17 00:00:00 2001 From: 0xmrpeter <0xmrpeter@gmail.com> Date: Sun, 22 Mar 2026 22:42:14 +0700 Subject: [PATCH] fix(agents): include agent base args in agents run command The agents run command was only passing user args, missing the agent's own args (e.g., package name for npx). Now includes base args while stripping ACP-specific flags (--acp, acp) so the interactive CLI works. --- src/cli/commands.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cli/commands.ts b/src/cli/commands.ts index fe3fbf3..94659c0 100644 --- a/src/cli/commands.ts +++ b/src/cli/commands.ts @@ -1025,11 +1025,15 @@ async function agentsRun(nameOrId: string | undefined, extraArgs: string[]): Pro } // Strip leading "--" separator if present - const args = extraArgs[0] === "--" ? extraArgs.slice(1) : extraArgs; + const userArgs = extraArgs[0] === "--" ? extraArgs.slice(1) : extraArgs; const { spawnSync } = await import("node:child_process"); const command = installed.command; - const fullArgs = [...args]; + + // Include agent's base args (e.g., package name for npx) but strip ACP-specific flags + const acpFlags = new Set(["--acp", "acp", "--acp=true"]); + const baseArgs = installed.args.filter((a) => !acpFlags.has(a)); + const fullArgs = [...baseArgs, ...userArgs]; console.log(`\n Running: ${command} ${fullArgs.join(" ")}\n`);