Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(tools): handle empty write content gracefully

Steven Enamakele87fd90d2b5d
diff --git a/crates/openhuman-core/src/skills/tools/write.rs b/crates/openhuman-core/src/skills/tools/write.rs
index 5a5f95fcdc..854e4290be 100644
--- a/crates/openhuman-core/src/skills/tools/write.rs
+++ b/crates/openhuman-core/src/skills/tools/write.rs
@@ -1,5 +1,5 @@
-//! Mutating workflow tools: scaffold, install-from-url, and uninstall. All
-//! ship default-OFF via `tools/user_filter.rs`.
+//! Mutating workflow tools: scaffold and install-from-url. Uninstall lives in
+//! `tools_uninstall.rs`. All ship default-OFF via `tools/user_filter.rs`.
use std::path::PathBuf;
use std::sync::Arc;
@@ -11,10 +11,7 @@ use crate::config::Config;
use tinytools::{PermissionLevel, Tool, ToolResult};
use super::super::ops_create::{create_workflow, CreateWorkflowParams};
-use super::super::ops_install::{
- install_workflow_from_url, uninstall_workflow, InstallWorkflowFromUrlParams,
- UninstallWorkflowParams,
-};
+use super::super::ops_install::{install_workflow_from_url, InstallWorkflowFromUrlParams};
use super::helpers::read_required_str;
/// Scaffold a new user skill. **Writes to disk** — default-OFF.
@@ -133,40 +130,3 @@ impl Tool for WorkflowInstallFromUrlTool {
Ok(ToolResult::success(serde_json::to_string(&outcome)?))
}
}
-
-/// Uninstall a user skill. **Deletes from disk** — default-OFF.
-pub struct WorkflowUninstallTool;
-
-#[async_trait]
-impl Tool for WorkflowUninstallTool {
- fn name(&self) -> &str {
- "uninstall_workflow"
- }
-
- fn description(&self) -> &str {
- "Uninstall a user-scope workflow by `name`, deleting its directory under \
- `~/.openhuman/skills/`. Irreversible; project/legacy workflows are \
- read-only and cannot be removed. Only use when the user asks to remove \
- a specific workflow."
- }
-
- fn parameters_schema(&self) -> serde_json::Value {
- json!({
- "type": "object",
- "properties": { "name": { "type": "string", "description": "Workflow name (directory) to remove." } },
- "required": ["name"]
- })
- }
-
- fn permission_level(&self) -> PermissionLevel {
- PermissionLevel::Dangerous
- }
-
- async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {
- log::debug!("[tool][skills] uninstall invoked");
- let name = read_required_str(&args, "name")?;
- let outcome = uninstall_workflow(UninstallWorkflowParams { name }, None)
- .map_err(|e| anyhow::anyhow!("uninstall_workflow: {e}"))?;
- Ok(ToolResult::success(serde_json::to_string(&outcome)?))
- }
-}