mirror of
https://github.com/ultraworkers/claw-code.git
synced 2026-05-07 05:02:13 +08:00
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:
parent
5eb4b8a944
commit
85435ad4b5
@ -877,13 +877,17 @@ fn parse_args(args: &[String]) -> Result<CliAction, String> {
|
||||
// `missing Anthropic credentials` even though the command is purely
|
||||
// local introspection. Mirror `agents`/`mcp`/`skills`: action is the
|
||||
// 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 action = tail.first().cloned();
|
||||
let target = tail.get(1).cloned();
|
||||
if tail.len() > 2 {
|
||||
return Err(format!(
|
||||
"unexpected extra arguments after `claw plugins {}`: {}",
|
||||
"unexpected extra arguments after `claw {} {}`: {}",
|
||||
rest[0],
|
||||
tail[..2].join(" "),
|
||||
tail[2..].join(" ")
|
||||
));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user