1514 Commits

Author SHA1 Message Date
YeonGyu-Kim
892d8f9ea6 fix: direct-slash resume-safe commands route to CliAction instead of interactive_only (#831)
`claw /status`, `claw /diff`, `claw /version`, `claw /doctor`,
`claw /sandbox` all returned interactive_only because the direct-slash
handler only had explicit arms for /help, /agents, /mcp, /skills.
Other resume-safe slash commands fell through to the generic
`Ok(Some(command)) => Err(interactive_only...)` arm.

Fix: add explicit routing arms for SlashCommand::Status, ::Diff,
::Version, ::Doctor, ::Sandbox in `parse_direct_slash_command`.

One new integration test: direct_slash_resume_safe_commands_route_correctly
(covers /version, /sandbox, /diff)

572+ tests pass.
2026-05-29 17:11:00 +09:00
YeonGyu-Kim
63931c74fb fix: mcp show (missing server name) emits missing_argument error_kind (#830)
`claw --output-format json mcp show` (no server name) previously emitted
error_kind:"unknown_mcp_action" — misleading because `show` IS a known
action; the problem is a missing required argument.

Fix:
- `render_mcp_report_json_for`: `Some("show")` arm now emits a dedicated
  JSON response with error_kind:"missing_argument" + usage hint
- `classify_error_kind`: add classifier arm for "missing_argument:" prefix

One new test: mcp_show_missing_server_name_emits_missing_argument

572+ tests pass.
2026-05-29 17:07:15 +09:00
YeonGyu-Kim
4d3dc5b873 docs: record #830 - mcp show missing server name emits unknown_mcp_action instead of missing_argument 2026-05-29 16:57:22 +09:00
YeonGyu-Kim
ac5b19dee1
fix: interactive_only hint omits --resume for non-resume-safe commands (#829)
Commands like /commit, /pr, /issue, /bughunter, /ultraplan are
interactive-only and NOT resume-safe. Previously the generic
interactive_only error always suggested 'claw --resume SESSION.jsonl
/commit', which would just re-trigger interactive_only.

Fix: check commands::resume_supported_slash_commands() in the
SlashCommand::Ok(Some(cmd)) arm. Resume-safe commands get the full
--resume suggestion; non-resume-safe commands only say 'Start claw'.

Also update two existing unit tests whose assertions checked for the old
'interactive-only' substring (now 'interactive_only:' prefix).

Two new integration tests:
- non_resume_safe_interactive_only_hint_omits_resume_suggestion
- resume_safe_interactive_only_hint_includes_resume_suggestion

572 tests pass, 1 pre-existing worker_boot failure unrelated.
2026-05-29 16:55:57 +09:00
YeonGyu-Kim
fdfb9f4dc1 docs: record #829 - interactive_only hint incorrectly suggests --resume for non-resume-safe commands 2026-05-29 16:38:04 +09:00
YeonGyu-Kim
187aebd74f
fix: /approve and /deny outside REPL emit interactive_only error_kind (#828)
/approve, /yes, /deny, /no (and /y, /n) are valid REPL-only slash
commands. Outside the REPL they were falling through to
format_unknown_direct_slash_command -> error_kind:unknown_slash_command.

Fix: intercept them in the SlashCommand::Unknown arm and emit
interactive_only: prefix so classify_error_kind returns the correct kind.

One new test: approve_deny_outside_repl_emits_interactive_only (covers
/approve, /yes, /deny, /no)

572 tests pass, 1 pre-existing worker_boot failure unrelated.
2026-05-29 16:36:54 +09:00
YeonGyu-Kim
9d05573f24
fix: unknown slash command emits unknown_slash_command error_kind (#827)
Both direct-slash CLI path (claw /boguscommand) and resume slash path
(claw --resume session /boguscommand) previously emitted error_kind:unknown
(opaque fallback). Machine consumers could not distinguish unrecognized
slash commands from other error classes.

Fix:
- format_unknown_direct_slash_command: prefix with 'unknown_slash_command:'
- format_unknown_slash_command (resume path): prefix with 'unknown_slash_command:'
- Add classifier arm for 'unknown_slash_command:' prefix

One new regression test: direct_unknown_slash_command_emits_typed_error_kind
Uses the direct-slash CLI path (no session load needed; reproducible on CI).

572 tests pass, 1 pre-existing worker_boot failure unrelated.
2026-05-29 16:00:37 +09:00
YeonGyu-Kim
58902915f6 docs: record #827 - resume unknown slash command emits opaque error_kind:unknown 2026-05-29 14:59:12 +09:00
YeonGyu-Kim
d47b015100
fix: unknown single-word subcommand emits command_not_found (#825/#826)
Single-word all-alpha/dash tokens that don't match any known subcommand
now always emit command_not_found (with or without fuzzy suggestions).

Multi-word cases fall through to CliAction::Prompt (natural language
prompt passthrough like 'claw explain this' must still work). The
multi-word gap is documented as ROADMAP #826 (known limitation).

Tests:
- unknown_subcommand_json_emits_command_not_found (new)
- unknown_subcommand_text_emits_command_not_found_on_stderr (new)
- unknown_subcommand_typo_with_suggestions_json_emits_command_not_found (new)
- multi_word_unknown_subcommand_falls_through_to_prompt_826 (documents gap)

572 tests pass, 1 pre-existing worker_boot failure unrelated.
2026-05-29 14:58:07 +09:00
YeonGyu-Kim
5458d3547a docs: record #826 - multi-word unknown subcommand falls through to missing_credentials 2026-05-29 14:38:09 +09:00
YeonGyu-Kim
70d64be033
fix: unknown single-word subcommand emits command_not_found instead of missing_credentials (#825)
When looks_like_subcommand_typo fires on a single word with no close
fuzzy matches, the fallthrough reached CliAction::Prompt → provider
startup → misleading missing_credentials error.

Fix: always return Err with command_not_found: prefix from the typo
guard (with or without suggestions). Added command_not_found classifier
arm in classify_error_kind. Unified existing unknown_subcommand kind
under command_not_found in #825.

Three new regression tests in output_format_contract.rs:
- unknown_subcommand_json_emits_command_not_found
- unknown_subcommand_text_emits_command_not_found_on_stderr
- unknown_subcommand_typo_with_suggestions_json_emits_command_not_found

Updated pre-existing unit test assertion (starts_with → contains) and
classifier unit test (unknown_subcommand → command_not_found).

572 tests pass, 1 pre-existing worker_boot failure unrelated.
2026-05-29 14:37:29 +09:00
YeonGyu-Kim
de7edd5bb1
fix: suppress config deprecation stderr in JSON mode globally (#824)
Add SUPPRESS_CONFIG_WARNINGS_STDERR AtomicBool flag in runtime/config.rs
and expose suppress_config_warnings_for_json_mode() via runtime crate.

In main.rs, scan raw argv for --output-format json before parse_args
and activate the flag so no settings-load warnings reach stderr on any
JSON-mode surface (status, sandbox, system-prompt, mcp list, skills list,
agents list, --resume /config*, etc.).

Text-mode surfaces are unaffected; prose deprecation warnings continue
to appear on stderr.

All 572+ tests pass (one pre-existing worker_boot failure unrelated).
2026-05-29 14:00:32 +09:00
YeonGyu-Kim
f0e6671538 docs: record #824 - global settings-load deprecation leaks to stderr in JSON mode 2026-05-29 13:34:29 +09:00
YeonGyu-Kim
b4b1ba10f6
fix: route all JSON-mode abort envelopes to stdout (#819 #820 #823) (#3197)
* fix: route all JSON-mode abort envelopes to stdout (#819 #820 #823)

All handled errors in --output-format json mode now write the structured
abort envelope to stdout (rc=1) and keep stderr empty. Previously the
top-level error handler and resume_session JSON branches used eprintln!
which sent the envelope to stderr, breaking machine consumers that read
stdout for command payloads.

Surfaces fixed:
- Top-level abort handler (main.rs): export --session <missing>,
  session <subcommand>, prompt (no text), unknown subcommand fallthrough,
  flag errors, and all other run() failures
- resume_session JSON branches: session load errors, unsupported commands,
  parse errors, command execution errors

Test changes: updated 24 failing contract tests to assert JSON envelopes
on stdout. Added stderr-clean assertions where appropriate. 70 contract
tests pass (was 68; 2 additional from regression coverage).

ROADMAP: #819 (export session-not-found), #820 (interactive_only class),
#823 (missing prompt)

* style: cargo fmt on main.rs after eprintln->println fix

* fix(tests): fmt + update compact_output test for stdout abort envelope routing

* fix(tests): update resume_slash_commands stub test for stdout envelope routing
2026-05-29 13:30:35 +09:00
YeonGyu-Kim
e50c46c1ed docs: extend #821 - config/providers also leak deprecation warning in JSON mode 2026-05-29 12:01:09 +09:00
YeonGyu-Kim
3dbb35c3aa docs: record prompt missing-text JSON stderr routing gap (#823) 2026-05-29 11:31:28 +09:00
YeonGyu-Kim
3a76c4f4fd docs: record unknown subcommand falls through to provider startup (#822) 2026-05-29 11:01:13 +09:00
YeonGyu-Kim
69b59079c5 docs: record status/sandbox/system-prompt JSON stderr deprecation leak (#821) 2026-05-29 10:31:13 +09:00
YeonGyu-Kim
42aff269d1 docs: record interactive_only error class JSON stderr routing gap (#820) 2026-05-29 10:01:01 +09:00
YeonGyu-Kim
efe59c22e4 docs: record export session-not-found JSON stderr routing gap (#819) 2026-05-29 09:33:25 +09:00
YeonGyu-Kim
37a9a543d6 docs: record AGENTS.md and .claude/CLAUDE.md instruction cascade gap (#818) 2026-05-29 08:09:51 +09:00
Bellman
0800d7ae88
Route plugins list JSON parse errors to stdout (#3194) 2026-05-28 22:35:58 +09:00
Bellman
69b8b367c1
docs: record plugins trailing dash json routing (#3193) 2026-05-28 21:35:25 +09:00
Bellman
9494e3c26f
Suppress config warnings on JSON local surfaces (#3192) 2026-05-28 20:34:18 +09:00
Bellman
ed3a616e62
docs: record global json warning leak (#3191) 2026-05-28 18:36:30 +09:00
Bellman
89e7f415a9
Avoid duplicate config warnings for JSON consumers (#3190)
JSON config output already carries collected config diagnostics in warnings[], so prose stderr emission must be reserved for text/local paths. Lazy permission-mode default resolution prevents an earlier config load from leaking the same deprecation before the JSON renderer runs.\n\nConstraint: ROADMAP #815 requires text mode to keep human stderr warnings while JSON config/list suppresses duplicate app-level config prose.\nRejected: Filtering all stderr in JSON mode | would hide cargo/compiler or unrelated diagnostics outside the app config warning path.\nConfidence: high\nScope-risk: narrow\nDirective: Keep load_collecting_warnings side-effect-free; use load() for human stderr emission.\nTested: cargo fmt; cargo test -p rusty-claude-cli --test output_format_contract config_json_reports_deprecations_structurally_without_stderr_duplicate_815; cargo test -p rusty-claude-cli --test output_format_contract; manual target/debug/claw JSON config fixture.\nNot-tested: cargo clippy -p rusty-claude-cli --all-targets -- -D warnings is blocked by pre-existing runtime dead_code/trident warnings.
2026-05-28 18:09:59 +09:00
Bellman
c3e7b6af60
docs: record config json warning duplication (#3189) 2026-05-28 17:05:57 +09:00
Bellman
3af2d9f986
docs: verify trailing json inventory gap resolved (#3188) 2026-05-28 16:36:11 +09:00
Bellman
09ff1caf42
docs: record trailing json inventory timeout (#3187) 2026-05-28 16:05:50 +09:00
Bellman
0e6d48d9dc
docs: record argv-safe dogfood probe gap (#3186) 2026-05-28 15:34:04 +09:00
Bellman
b7ea04661a
test: cover doctor help JSON flag order (#3185) 2026-05-28 14:34:19 +09:00
Bellman
73d8d6e638
Keep doctor help machine-discoverable locally (#3184)
Doctor help was already on the local help path in current source, but the exact #702 dogfood surface lacked a focused guard and the JSON help envelope was still too prose-oriented for wrappers. Strengthen the JSON contract while preserving text help.\n\nConstraint: Preserve unrelated dirty rust/Cargo.lock from prior #701 work.\nRejected: Starting runtime/provider/session to inspect doctor semantics | help must be local and credential-free.\nConfidence: high\nScope-risk: narrow\nDirective: Keep doctor help routed through parse_local_help_action and print_help_topic; do not call run_doctor for --help.\nTested: cargo test --manifest-path rust/Cargo.toml -p rusty-claude-cli --test output_format_contract doctor_help -- --nocapture; cargo test --manifest-path rust/Cargo.toml -p rusty-claude-cli --test output_format_contract help -- --nocapture; cargo fmt --manifest-path rust/Cargo.toml --all -- --check; cargo check --manifest-path rust/Cargo.toml -p rusty-claude-cli; timeout 5s cargo run -q --bin claw -- --output-format json doctor --help; timeout 5s cargo run -q --bin claw -- doctor --help.\nNot-tested: full workspace test suite.
2026-05-28 13:31:39 +09:00
Bellman
9ac66cbeb3
docs: quote dogfood build trap cleanup guidance (#3183) 2026-05-28 12:35:47 +09:00
Bellman
773aa021be
docs: use trap cleanup in dogfood build guidance (#3182) 2026-05-28 12:06:17 +09:00
Bellman
5c3e1c1444
fix: add dogfood build help handling (#3181) 2026-05-28 11:36:13 +09:00
Bellman
3260258b56
fix: make cc2 renderer path errors concise (#3180) 2026-05-28 11:08:26 +09:00
Bellman
a88d52fe88
fix: make cc2 validator directory board error concise (#3179) 2026-05-28 10:38:57 +09:00
Bellman
60f44d314b
fix: avoid cc2 generator dirs on missing source (#3178) 2026-05-28 10:07:38 +09:00
Bellman
d4e9829329
fix: suppress partial cc2 wrapper validate pass output (#3177) 2026-05-28 09:36:18 +09:00
Bellman
e17098cc70
fix: resolve cc2 wrapper tools from script root (#3176) 2026-05-28 08:36:16 +09:00
Bellman
e17936158a
fix: make cc2 validator board read errors concise (#3175) 2026-05-28 08:06:28 +09:00
Bellman
760e69675c
fix: make cc2 generator missing source error concise (#3174) 2026-05-28 07:36:47 +09:00
Bellman
193f11171a
fix: reject extra roadmap helper paths (#3173) 2026-05-28 06:34:44 +09:00
Bellman
f11ac23e1f
fix: add roadmap next-id help handling (#3172) 2026-05-28 06:06:42 +09:00
Bellman
c4770e6571
docs(roadmap): add #811 json error envelope nontty hangs (#3171) 2026-05-28 05:35:57 +09:00
Bellman
b0e94c996b
docs(roadmap): add #810 json stdout warning contamination (#3169) 2026-05-28 05:05:17 +09:00
Bellman
85d63b071c
docs(roadmap): add #809 help mcp plugin json hangs (#3168) 2026-05-28 04:30:30 +09:00
Bellman
db81598525
docs(roadmap): add #808 control-plane json hangs (#3166) 2026-05-28 03:32:15 +09:00
Bellman
86f45a11ef
docs(roadmap): add #807 model json hang (#3163) 2026-05-28 01:33:01 +09:00
YeonGyu-Kim
87b7e74770 fix(#806): plugins show <not-found> in text mode returned empty success instead of error 2026-05-27 22:34:10 +09:00