tinyhumansai/openhuman · error

missing required string argument `contents`

Error message

missing required string argument `contents`

What it means

The workspace_update_persona tool was invoked without `contents` (absent or not a string). `filename` was already validated by req_str; this guard is the second required field of the write path — there is nothing to write without it.

Source

Thrown at src/openhuman/config/workspace/tools.rs:105

        json!({
            "type": "object",
            "properties": {
                "filename": { "type": "string", "enum": ["SOUL.md", "IDENTITY.md"] },
                "contents": { "type": "string" }
            },
            "required": ["filename", "contents"]
        })
    }
    fn permission_level(&self) -> PermissionLevel {
        PermissionLevel::Write
    }
    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {
        log::debug!("[tool][workspace] update_persona invoked");
        let filename = req_str(&args, "filename")?;
        let contents = args
            .get("contents")
            .and_then(Value::as_str)
            .ok_or_else(|| anyhow::anyhow!("missing required string argument `contents`"))?;
        let outcome = rpc::write_workspace_file(&self.config.workspace_dir, &filename, contents)
            .map_err(|e| anyhow::anyhow!("workspace_update_persona: {e}"))?;
        Ok(ToolResult::success(serde_json::to_string(&outcome.value)?))
    }
}

/// Reset a persona file to its bundled default. Default-OFF.
pub struct WorkspaceResetPersonaTool {
    config: Arc<Config>,
}
impl WorkspaceResetPersonaTool {
    pub fn new(config: Arc<Config>) -> Self {
        Self { config }
    }
}
#[async_trait]
impl Tool for WorkspaceResetPersonaTool {
    fn name(&self) -> &str {

View on GitHub (pinned to 7491200858)

Solutions

  1. Pass the full new file contents as the `contents` string
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/config/workspace/tools.rs:105 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/444cd0183db8b371. Report an issue: GitHub.