Repository navigation
Conversation
rig ask <rig> prints "[not found]" (or the JSON with rig: null) but exits 0, so a script or agent cannot tell a mistyped or ambiguous rig name from an answer with no matches. rig send, transcript and release already exit 1 for a missing target. Set process.exitCode = 1 when the daemon returns rig: null, in both human and --json modes. Output is unchanged, and a found rig with insufficient evidence still exits 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Thanks, @Coder8124. It's in review, and we'll reply here. |
|
Thanks, @Coder8124, for #1202. We'd like this change: |
Problem
rig ask <rig> "<question>"exits 0 when the rig doesn't exist. The daemon answers withrig: nulland guidance (ask-service.ts:80), and the CLI printsRig: nosuchrig [not found], or the JSON in--jsonmode, but the exit status is 0. A script or agent therefore can't tell a mistyped or ambiguous rig name from a real answer that found nothing.rig send,rig transcriptandrig releasealready exit 1 when their target is missing.Fix
When the daemon returns
rig: null, setprocess.exitCode = 1. This applies in both human and--jsonmode. The output itself doesn't change. When the rig is found but the evidence is insufficient (for example, no useful keywords), the command still exits 0.Tests
packages/cli/test/ask.test.ts:--json, an unknown rig still prints parseable JSON withrig: nulland exits 1.Without the fix, both unknown-rig assertions fail.
npx vitest run test/askpasses (32 tests) andtsc --noEmitis clean.🤖 Generated with Claude Code
Summary by CodeRabbit
askcommand now exits with status 1 when a rig name matches no rig or matches multiple rigs. It continues to display the existing human-readable or JSON result, includingrig: nullin JSON output for an unknown rig.