tinyhumansai/openhuman · error

Missing 'new_string' parameter

Error message

Missing 'new_string' parameter

What it means

Edit-file tool argument guard: 'path' and 'old_string' parsed, but 'new_string' is absent or not a string. The replacement half of the edit is missing; no file is touched.

Source

Thrown at src/openhuman/tools/impl/filesystem/edit_file.rs:99

impl EditFileTool {
    async fn execute_in_context(
        &self,
        args: serde_json::Value,
        context: Option<&ToolExecutionContext>,
    ) -> anyhow::Result<ToolResult> {
        let path = args
            .get("path")
            .and_then(|v| v.as_str())
            .ok_or_else(|| anyhow::anyhow!("Missing 'path' parameter"))?;
        let old_string = args
            .get("old_string")
            .and_then(|v| v.as_str())
            .ok_or_else(|| anyhow::anyhow!("Missing 'old_string' parameter"))?;
        let new_string = args
            .get("new_string")
            .and_then(|v| v.as_str())
            .ok_or_else(|| anyhow::anyhow!("Missing 'new_string' parameter"))?;
        let replace_all = args
            .get("replace_all")
            .and_then(|v| v.as_bool())
            .unwrap_or(false);

        if old_string.is_empty() {
            return Ok(ToolResult::error("`old_string` must not be empty"));
        }
        if old_string == new_string {
            return Ok(ToolResult::error(
                "`old_string` and `new_string` are identical — nothing to do",
            ));
        }

        if !self.security.can_act() {
            return Ok(ToolResult::error(
                "[policy-blocked] Action blocked: autonomy is read-only",
            ));

View on GitHub (pinned to 7491200858)

Solutions

  1. Provide 'new_string' as a string (empty string is valid for a deletion)
  2. Include all three of path, old_string, new_string
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/tools/impl/filesystem/edit_file.rs:99 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/4e4bb48d69cf7388. Report an issue: GitHub.