fix(permissions): return guidance for multi-word forms instead of falling through to LLM#2994
Merged
code-yeongyu merged 1 commit intomainfrom May 4, 2026
Merged
Conversation
…ling through to LLM claw permissions list / claw permissions allow <tool> / claw permissions deny <tool> all fell through to the prompt/LLM path because parse_subcommand had no arm for "permissions". The single-word bare form was already intercepted by bare_slash_command_guidance, but any form with rest.len() > 1 bypassed the single-word guard and landed in the _other => CliAction::Prompt branch. Fix: add a "permissions" arm in parse_subcommand that returns a structured guidance Err so all multi-word forms get the same exit:1 + JSON error as the bare single-word form, without any LLM call or session creation. Verified: all invocation forms (bare, list, read-only, workspace-write, allow/deny <tool>) exit 1 with kind:unknown guidance JSON. Zero sessions.
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 permissions list,claw permissions allow bash,claw permissions deny bashetc. all fall through to the prompt/LLM path, calling the Anthropic API and returning auth errors. Only the bare single-word formclaw permissionswas intercepted bybare_slash_command_guidance.Root Cause
parse_single_word_command_aliasguards onrest.len() != 1and returnsNonefor multi-word forms, thenparse_subcommandhad no"permissions"arm so those forms hit_other => CliAction::Prompt.Same root cause cluster as
claw plugin list/claw marketplacefixed in #2993.Fix
Add a
"permissions"arm inparse_subcommandreturning a structured guidanceErrwith the correct usage hint.Verification
All 6 invocation forms tested — all exit 1 with
kind:unknownguidance JSON, zero sessions created: