fix: unknown single-word subcommand emits command_not_found instead of missing_credentials (#825)#3199
Merged
Merged
Conversation
…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.
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.
Fixes ROADMAP #825.
Before:
claw foobar→missing_credentials(after full provider startup attempt)After:
claw foobar→command_not_found(immediate, no provider startup)Root cause:
looks_like_subcommand_typofired for all single-word all-alpha inputs, but only returned an error when fuzzy suggestions existed. No-suggestion fallthrough reachedCliAction::Prompt→ Anthropic startup → misleading error.Fix: Always emit
command_not_found:from the typo guard. Addedcommand_not_foundto the classifier. Unified oldunknown_subcommandkind undercommand_not_found.Tests: 3 new regression tests, 1 existing test updated, 572 pass.