{"record":{"id":"35d00f876ff89c31","repo":"tinyhumansai/openhuman","slug":"artifact-delete-e","errorCode":null,"errorMessage":"artifact_delete: {e}","messagePattern":"artifact_delete: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/artifacts/tools.rs","lineNumber":192,"sourceCode":"        json!({\n            \"type\": \"object\",\n            \"properties\": {\n                \"artifact_id\": { \"type\": \"string\", \"description\": \"The artifact id (UUID) to delete.\" }\n            },\n            \"required\": [\"artifact_id\"]\n        })\n    }\n\n    fn permission_level(&self) -> PermissionLevel {\n        PermissionLevel::Dangerous\n    }\n\n    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {\n        log::debug!(\"[tool][artifacts] delete invoked\");\n        let id = read_required_str(&args, \"artifact_id\")?;\n        let outcome = ops::ai_delete_artifact(&self.config, &id)\n            .await\n            .map_err(|e| anyhow::anyhow!(\"artifact_delete: {e}\"))?;\n        Ok(ToolResult::success(serde_json::to_string(&outcome.value)?))\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use crate::openhuman::tools::traits::ToolScope;\n\n    fn test_config() -> Arc<Config> {\n        Arc::new(Config::default())\n    }\n\n    #[test]\n    fn metadata_is_stable() {\n        let cfg = test_config();\n        assert_eq!(ArtifactListTool::new(cfg.clone()).name(), \"artifact_list\");\n        assert_eq!(ArtifactGetTool::new(cfg.clone()).name(), \"artifact_get\");","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/artifacts/tools.rs#L174-L210","documentation":"Error-context wrapper in the ArtifactDeleteTool execute path. The tool is PermissionLevel::Dangerous; after the required artifact_id passes validation, `ops::ai_delete_artifact` runs and any failure (id not found, store write error, policy refusal) is re-emitted as `artifact_delete: {e}` with the cause appended, so the agent sees which destructive tool failed.","triggerScenarios":"Thrown at src/openhuman/agent/artifacts/tools.rs:192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the artifact_id exists via artifact_get before deleting.","Read the cause after `artifact_delete:` — a not-found cause means nothing was removed.","If the deletion was blocked by policy/permissions, the cause will say so; adjust access tier or approval and retry."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}