tinyhumansai/openhuman · error

artifact_delete

Error message

artifact_delete: {e}

What it means

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.

Solutions

  1. Confirm the artifact_id exists via artifact_get before deleting.
  2. Read the cause after `artifact_delete:` — a not-found cause means nothing was removed.
  3. If the deletion was blocked by policy/permissions, the cause will say so; adjust access tier or approval and retry.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/openhuman/agent/artifacts/tools.rs:192 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/35d00f876ff89c31. Report an issue: GitHub.

Appendix: source

Thrown at src/openhuman/agent/artifacts/tools.rs:192

        json!({
            "type": "object",
            "properties": {
                "artifact_id": { "type": "string", "description": "The artifact id (UUID) to delete." }
            },
            "required": ["artifact_id"]
        })
    }

    fn permission_level(&self) -> PermissionLevel {
        PermissionLevel::Dangerous
    }

    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {
        log::debug!("[tool][artifacts] delete invoked");
        let id = read_required_str(&args, "artifact_id")?;
        let outcome = ops::ai_delete_artifact(&self.config, &id)
            .await
            .map_err(|e| anyhow::anyhow!("artifact_delete: {e}"))?;
        Ok(ToolResult::success(serde_json::to_string(&outcome.value)?))
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    use crate::openhuman::tools::traits::ToolScope;

    fn test_config() -> Arc<Config> {
        Arc::new(Config::default())
    }

    #[test]
    fn metadata_is_stable() {
        let cfg = test_config();
        assert_eq!(ArtifactListTool::new(cfg.clone()).name(), "artifact_list");
        assert_eq!(ArtifactGetTool::new(cfg.clone()).name(), "artifact_get");

View on GitHub (pinned to 7491200858)