fix: skills install nonexistent path emits skill_not_found error kind with descriptive message; classify_error_kind adds skill_not_found branch

This commit is contained in:
YeonGyu-Kim
2026-05-25 19:34:25 +09:00
parent 9d1998b3fd
commit de2e32c5d4
2 changed files with 8 additions and 1 deletions

View File

@@ -3240,7 +3240,12 @@ fn resolve_skill_install_source(source: &str, cwd: &Path) -> std::io::Result<Ski
} else {
cwd.join(candidate)
};
let source = fs::canonicalize(&source)?;
let source = fs::canonicalize(&source).map_err(|e| {
std::io::Error::new(
e.kind(),
format!("skill source '{}' not found: {e}", source.display()),
)
})?;
if source.is_dir() {
let prompt_path = source.join("SKILL.md");

View File

@@ -298,6 +298,8 @@ fn classify_error_kind(message: &str) -> &'static str {
"unknown_agents_subcommand"
} else if message.contains("is not installed") {
"plugin_not_found"
} else if message.contains("skill source") && message.contains("not found") {
"skill_not_found"
} else {
"unknown"
}