{"record":{"id":"9aed064fc973f91e","repo":"sigoden/aichat","slug":"no-kind-to-delete","errorCode":null,"errorMessage":"No {kind} to delete","messagePattern":"No (.+?) to delete","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/mod.rs","lineNumber":731,"sourceCode":"                            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                    }\n                }\n                names.sort_unstable();\n                names\n            }\n            Err(_) => vec![],\n        };\n\n        if names.is_empty() {\n            bail!(\"No {kind} to delete\")\n        }\n\n        let select_names = MultiSelect::new(&format!(\"Select {kind} to delete:\"), names)\n            .with_validator(|list: &[ListOption<&String>]| {\n                if list.is_empty() {\n                    Ok(Validation::Invalid(\n                        \"At least one item must be selected\".into(),\n                    ))\n                } else {\n                    Ok(Validation::Valid)\n                }\n            })\n            .prompt()?;\n\n        for name in select_names {\n            match file_ext {\n                Some(ext) => {\n                    let path = dir.join(format!(\"{name}{ext}\"));","sourceCodeStart":713,"sourceCodeEnd":749,"githubUrl":"https://github.com/sigoden/aichat/blob/82976d349ad97ac9aae0655ad631dace5e2a6385/src/config/mod.rs#L713-L749","documentation":"Fires in delete() after listing the saved resources of the requested kind: if the directory listing is empty (or unreadable, yielding an empty vec), there is nothing to remove, so the operation aborts. It is an emptiness guard on the collection of names, not a filesystem error itself.","triggerScenarios":"Thrown at src/config/mod.rs:731 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create the resource of this kind first before attempting deletion","Verify the correct kind was specified (role vs session vs rag)","If the directory should contain items, check its path and permissions"],"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"}