fix(plugins): route plugin and marketplace aliases through local handler (#2993)

claw plugin list / claw marketplace / claw marketplace list all fell
through to the prompt/LLM path because parse_subcommand only matched
"plugins" (the primary name) while the canonical spec aliases
"plugin" and "marketplace" were unhandled.

This manifested as auth errors and session creation on direct
invocation — dogfood confirmed Gaebal's binary created one session
via plugin prompt fallback.

Fix: extend the plugins arm in parse_subcommand to also match
"plugin" | "marketplace" so all three forms route to the same
CliAction::Plugins without network calls or session creation.

Verified: all six forms (bare + list subcommand for each name) return
kind:plugin JSON, exit 0, and create zero sessions.

Closes ROADMAP #55 partial (plugins/marketplace bypass complete).
This commit is contained in:
YeonGyu-Kim 2026-05-05 05:16:00 +09:00 committed by GitHub
parent 5eb4b8a944
commit 85435ad4b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -877,13 +877,17 @@ fn parse_args(args: &[String]) -> Result<CliAction, String> {
// `missing Anthropic credentials` even though the command is purely // `missing Anthropic credentials` even though the command is purely
// local introspection. Mirror `agents`/`mcp`/`skills`: action is the // local introspection. Mirror `agents`/`mcp`/`skills`: action is the
// first positional arg, target is the second. // first positional arg, target is the second.
"plugins" => { // `plugin` (singular) and `marketplace` are aliases for `plugins`.
// All three must route to the same local handler so that no form
// falls through to the LLM/prompt path.
"plugins" | "plugin" | "marketplace" => {
let tail = &rest[1..]; let tail = &rest[1..];
let action = tail.first().cloned(); let action = tail.first().cloned();
let target = tail.get(1).cloned(); let target = tail.get(1).cloned();
if tail.len() > 2 { if tail.len() > 2 {
return Err(format!( return Err(format!(
"unexpected extra arguments after `claw plugins {}`: {}", "unexpected extra arguments after `claw {} {}`: {}",
rest[0],
tail[..2].join(" "), tail[..2].join(" "),
tail[2..].join(" ") tail[2..].join(" ")
)); ));