From b573924c6db965e7130daaab743070524ecf53a2 Mon Sep 17 00:00:00 2001 From: Anton_Yeromin Date: Fri, 3 Jul 2026 14:18:25 +0200 Subject: [PATCH] fix(skills): pass interactive flag to runSkillsCli in add command When -y/--yes is supplied the action computed interactive=false but did not forward it to runSkillsCli, which defaulted to interactive=true. In interactive mode the close handler calls process.stderr.write on the buffered stderr, which raises EPIPE when the parent process has a piped stderr (e.g. integration test spawnSync). The uncaught write error caused Node to exit with code 1 instead of propagating the real upstream exit code. Fix: pass interactive to runSkillsCli so non-interactive runs use piped stdio and avoid the write. Also forward result.stderr explicitly in non-interactive failure paths so egress-blocked and other markers are still visible to the caller's stderr stream. Generated with AI Co-Authored-By: codemie-ai --- src/cli/commands/skills/add.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cli/commands/skills/add.ts b/src/cli/commands/skills/add.ts index c639c3b6..3a13bbf2 100644 --- a/src/cli/commands/skills/add.ts +++ b/src/cli/commands/skills/add.ts @@ -83,6 +83,7 @@ export function createAddCommand(): Command { const result = await runSkillsCli(args, { cwd, timeoutMs: ADD_GIT_TIMEOUT_MS, + interactive, env: { GIT_TERMINAL_PROMPT: '0', GCM_INTERACTIVE: 'never', @@ -107,6 +108,10 @@ export function createAddCommand(): Command { return; } + if (!interactive && result.stderr) { + process.stderr.write(result.stderr); + } + const errorCode = classifySkillError({ result }); if (shouldShowGitAccessHelp(source, errorCode)) { process.stderr.write(formatGitAccessHelp(sanitizedSource, errorCode));