{"record":{"id":"41d537d067f9181d","repo":"sigoden/aichat","slug":"unknown-kind-kind","errorCode":null,"errorMessage":"Unknown kind '{kind}'","messagePattern":"Unknown kind '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/mod.rs","lineNumber":704,"sourceCode":"                config.write().save = value;\n            }\n            \"highlight\" => {\n                let value = value.parse().with_context(|| \"Invalid value\")?;\n                config.write().highlight = value;\n            }\n            _ => bail!(\"Unknown key '{key}'\"),\n        }\n        Ok(())\n    }\n\n    pub fn delete(config: &GlobalConfig, kind: &str) -> Result<()> {\n        let (dir, file_ext) = match kind {\n            \"role\" => (Self::roles_dir(), Some(\".md\")),\n            \"session\" => (config.read().sessions_dir(), Some(\".yaml\")),\n            \"rag\" => (Self::rags_dir(), Some(\".yaml\")),\n            \"macro\" => (Self::macros_dir(), Some(\".yaml\")),\n            \"agent-data\" => (Self::agents_data_dir(), None),\n            _ => bail!(\"Unknown kind '{kind}'\"),\n        };\n        let names = match read_dir(&dir) {\n            Ok(rd) => {\n                let mut names = vec![];\n                for entry in rd.flatten() {\n                    let name = entry.file_name();\n                    match file_ext {\n                        Some(file_ext) => {\n                            if let Some(name) = name.to_string_lossy().strip_suffix(file_ext) {\n                                names.push(name.to_string());\n                            }\n                        }\n                        None => {\n                            if entry.path().is_dir() {\n                                names.push(name.to_string_lossy().to_string());\n                            }\n                        }\n                    }","sourceCodeStart":686,"sourceCodeEnd":722,"githubUrl":"https://github.com/sigoden/aichat/blob/82976d349ad97ac9aae0655ad631dace5e2a6385/src/config/mod.rs#L686-L722","documentation":"Raised by the delete command handler when the 'kind' argument does not match a supported resource type ('role', 'session', 'rag', etc.), each of which maps to a directory and file extension. It is a generic validation guard; the input at fault is the unknown 'kind' string passed to delete().","triggerScenarios":"Thrown at src/config/mod.rs:704 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a supported kind such as role, session, or rag","Check command documentation for the exact list of deletable resource types","Fix casing or pluralization mistakes in the kind argument"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"82976d349ad97ac9aae0655ad631dace5e2a6385","analyzedAt":"2026-09-09T18:33:06.139Z","contentChangedAt":"2026-09-09T18:33:06.139Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}