Skip to content

fix: unknown single-word subcommand emits command_not_found instead of missing_credentials (#825)#3199

Merged
code-yeongyu merged 1 commit into
mainfrom
fix/command-not-found-825
May 29, 2026
Merged

fix: unknown single-word subcommand emits command_not_found instead of missing_credentials (#825)#3199
code-yeongyu merged 1 commit into
mainfrom
fix/command-not-found-825

Conversation

@code-yeongyu
Copy link
Copy Markdown
Collaborator

Fixes ROADMAP #825.

Before: claw foobarmissing_credentials (after full provider startup attempt)
After: claw foobarcommand_not_found (immediate, no provider startup)

Root cause: looks_like_subcommand_typo fired for all single-word all-alpha inputs, but only returned an error when fuzzy suggestions existed. No-suggestion fallthrough reached CliAction::Prompt → Anthropic startup → misleading error.

Fix: Always emit command_not_found: from the typo guard. Added command_not_found to the classifier. Unified old unknown_subcommand kind under command_not_found.

Tests: 3 new regression tests, 1 existing test updated, 572 pass.

…f 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.
@code-yeongyu code-yeongyu merged commit 70d64be into main May 29, 2026
6 checks passed
@code-yeongyu code-yeongyu deleted the fix/command-not-found-825 branch May 29, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant