From e2168529394dbee4cb4c3dea3c278cbee1dceec5 Mon Sep 17 00:00:00 2001 From: Robbert Vermeulen Date: Fri, 16 Oct 2026 11:51:45 +0200 Subject: [PATCH] fix(runner): pass the prompt after -- so --mcp-config does not swallow it --mcp-config is variadic in the claude CLI, so the prompt that followed it was read as a second config file path and every session exited at once ("MCP config file not found"). The card bounced ready -> doing -> ready every minute. verify-trigger read the prompt from $1, which became --mcp-config; it now reads the last argument and fails when the prompt is not preceded by --. Co-Authored-By: Claude Opus 5.5 --- docs/superpowers/plans/verify-trigger.sh | 5 ++++- src/core/runner.ts | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/superpowers/plans/verify-trigger.sh b/docs/superpowers/plans/verify-trigger.sh index 72f2e14..ccf2b09 100755 --- a/docs/superpowers/plans/verify-trigger.sh +++ b/docs/superpowers/plans/verify-trigger.sh @@ -104,7 +104,9 @@ SCRATCH="$(mktemp -d)" export FAKE_OUT="$SCRATCH/calls.log" cat > "$SCRATCH/fake.sh" << 'EOF' #!/usr/bin/env bash -printf 'PROMPT-START\n%s\nPROMPT-END\n' "$1" >> "$FAKE_OUT" +printf 'PROMPT-START\n%s\nPROMPT-END\n' "${@: -1}" >> "$FAKE_OUT" +# `claude` options like --mcp-config are variadic: the prompt must sit after `--`. +[ "${@: -2:1}" = "--" ] || echo "PROMPT-NOT-AFTER-DASHDASH" >> "$FAKE_OUT" EOF chmod +x "$SCRATCH/fake.sh" export AGENTBOARD_SESSION_CMD="$SCRATCH/fake.sh" @@ -135,6 +137,7 @@ if [ -f "$AGENTBOARD_DATA/session.lock" ]; then fail "dry-run left a lock file"; $CLI runner >/dev/null [ "$(grep -c PROMPT-START "$FAKE_OUT")" = "1" ] || fail "fake session was not spawned exactly once" grep -q "main/weekly.md" "$FAKE_OUT" || fail "routine path missing from the prompt" +if grep -q PROMPT-NOT-AFTER-DASHDASH "$FAKE_OUT"; then fail "prompt not preceded by --"; fi grep -q "AGENT.md" "$FAKE_OUT" || fail "AGENT.md path missing from the prompt" $CLI routines due --json | python3 -c " import json,sys diff --git a/src/core/runner.ts b/src/core/runner.ts index 104f444..239f99a 100644 --- a/src/core/runner.ts +++ b/src/core/runner.ts @@ -387,6 +387,9 @@ export function runSession( ...parts.slice(1), '--mcp-config', mcpConfigArg(), + // --mcp-config is variadic: without `--` it swallows the prompt + // as a second config file and claude exits before doing anything. + '--', promptOverride ?? buildPrompt(active, card?.id ?? null), ], {