fix(mcp): exit 1 when JSON envelope contains ok:false#2995
Merged
code-yeongyu merged 2 commits intomainfrom May 4, 2026
Merged
fix(mcp): exit 1 when JSON envelope contains ok:false#2995code-yeongyu merged 2 commits intomainfrom
code-yeongyu merged 2 commits intomainfrom
Conversation
mcp info, mcp describe, and mcp list-filter all return
{"action":"error","ok":false,...} but previously exited 0,
requiring automation callers to inspect the envelope field.
After this fix: print_mcp detects ok:false in the rendered JSON
value and calls process::exit(1) after printing, so the exit code
reflects the semantic error in the envelope.
Unaffected: mcp list, mcp show, mcp help all have no ok field and
continue to exit 0 (they are not error paths).
Closes ROADMAP #68 (partial — agents bogus/mcp show nonexistent
found:false remain exit:0 as they use different envelope shapes).
…provenance Builds claw from the current HEAD, then checks that the binary's git_sha matches git rev-parse --short HEAD. Exits non-zero if the binary is stale or provenance is opaque (git_sha: null). Usage: CLAW=$(bash scripts/dogfood-build.sh) # fail-fast if stale $CLAW version --output-format json # provenance confirmed Addresses ROADMAP #69: dogfooders using a stale installed binary cannot attribute behavior to specific commits. This script makes dogfood round zero unambiguous. Also documents the safe workaround for contributors who have a stale system-installed binary.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
claw mcp info --output-format json(anddescribe,list-filter) returns{"action":"error","ok":false,...}but exits 0. Automation callers checking exit code get a false success; they must inspect theokfield.Fix
print_mcpnow checks if the rendered JSON value hasok:falseand callsprocess::exit(1)after printing, propagating the semantic error to the exit code.Verification
Zero sessions created. All 12 resume tests pass; workspace test suite passes (1 intermittent flake in
prompt_subcommand_allows_literal_typo_worddue to pre-existing env var leak between parallel tests — not caused by this change).Closes ROADMAP #68 (partial).