Skip to content

An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.

Rust

fix(#697): agents unknown subcommand exits 1 with typed error; plugins remove aliases uninstall and errors on not-found

YeonGyu-Kim91a0681ae98c
diff --git a/rust/crates/commands/src/lib.rs b/rust/crates/commands/src/lib.rs
index d431ad9f..12d4089e 100644
--- a/rust/crates/commands/src/lib.rs
+++ b/rust/crates/commands/src/lib.rs
@@ -2260,7 +2260,7 @@ pub fn handle_plugins_slash_command(
reload_runtime: true,
})
}
- Some("uninstall") => {
+ Some("remove") | Some("uninstall") => {
let Some(target) = target else {
return Ok(PluginsCommandResult {
message: "Usage: /plugins uninstall <plugin-id>".to_string(),
@@ -2327,7 +2327,10 @@ pub fn handle_agents_slash_command(args: Option<&str>, cwd: &Path) -> std::io::R
Ok(render_agents_report(&agents))
}
Some(args) if is_help_arg(args) => Ok(render_agents_usage(None)),
- Some(args) => Ok(render_agents_usage(Some(args))),
+ Some(args) => Err(std::io::Error::new(
+ std::io::ErrorKind::InvalidInput,
+ format!("unknown agents subcommand: {args}. Supported: list, help"),
+ )),
}
}
@@ -2348,7 +2351,10 @@ pub fn handle_agents_slash_command_json(args: Option<&str>, cwd: &Path) -> std::
Ok(render_agents_report_json(cwd, &agents))
}
Some(args) if is_help_arg(args) => Ok(render_agents_usage_json(None)),
- Some(args) => Ok(render_agents_usage_json(Some(args))),
+ Some(args) => Err(std::io::Error::new(
+ std::io::ErrorKind::InvalidInput,
+ format!("unknown agents subcommand: {args}. Supported: list, help"),
+ )),
}
}
diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rs
index 387c6d7f..41cdf194 100644
--- a/rust/crates/rusty-claude-cli/src/main.rs
+++ b/rust/crates/rusty-claude-cli/src/main.rs
@@ -294,6 +294,10 @@ fn classify_error_kind(message: &str) -> &'static str {
"empty_prompt"
} else if message.starts_with("interactive_only:") || message.contains("stdin is not a TTY") {
"interactive_only"
+ } else if message.starts_with("unknown agents subcommand:") {
+ "unknown_agents_subcommand"
+ } else if message.contains("is not installed") {
+ "plugin_not_found"
} else {
"unknown"
}