mirror of
https://github.com/instructkr/claude-code.git
synced 2026-05-31 09:46:44 +00:00
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.
This commit is contained in:
@@ -271,7 +271,9 @@ Run `claw --help` for usage."
|
||||
/// matching against the error messages produced throughout the CLI surface.
|
||||
fn classify_error_kind(message: &str) -> &'static str {
|
||||
// Check specific patterns first (more specific before generic)
|
||||
if message.starts_with("unknown_slash_command:") {
|
||||
if message.starts_with("missing_argument:") || message.starts_with("missing required argument:") {
|
||||
"missing_argument"
|
||||
} else if message.starts_with("unknown_slash_command:") {
|
||||
"unknown_slash_command"
|
||||
} else if message.starts_with("command_not_found:") {
|
||||
"command_not_found"
|
||||
|
||||
Reference in New Issue
Block a user