{"record":{"id":"20b832d08fa82f7a","repo":"tinyhumansai/openhuman","slug":"missing-old-string-parameter","errorCode":null,"errorMessage":"Missing 'old_string' parameter","messagePattern":"Missing 'old_string' parameter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/tools/impl/filesystem/edit_file.rs","lineNumber":95,"sourceCode":"    ) -> anyhow::Result<ToolResult> {\n        self.execute_in_context(args, context).await\n    }\n}\n\nimpl EditFileTool {\n    async fn execute_in_context(\n        &self,\n        args: serde_json::Value,\n        context: Option<&ToolExecutionContext>,\n    ) -> anyhow::Result<ToolResult> {\n        let path = args\n            .get(\"path\")\n            .and_then(|v| v.as_str())\n            .ok_or_else(|| anyhow::anyhow!(\"Missing 'path' parameter\"))?;\n        let old_string = args\n            .get(\"old_string\")\n            .and_then(|v| v.as_str())\n            .ok_or_else(|| anyhow::anyhow!(\"Missing 'old_string' parameter\"))?;\n        let new_string = args\n            .get(\"new_string\")\n            .and_then(|v| v.as_str())\n            .ok_or_else(|| anyhow::anyhow!(\"Missing 'new_string' parameter\"))?;\n        let replace_all = args\n            .get(\"replace_all\")\n            .and_then(|v| v.as_bool())\n            .unwrap_or(false);\n\n        if old_string.is_empty() {\n            return Ok(ToolResult::error(\"`old_string` must not be empty\"));\n        }\n        if old_string == new_string {\n            return Ok(ToolResult::error(\n                \"`old_string` and `new_string` are identical — nothing to do\",\n            ));\n        }\n","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/tools/impl/filesystem/edit_file.rs#L77-L113","documentation":"Guard in EditFileTool::execute_in_context: `path` was supplied but `old_string` is missing or not a string. Without the exact anchor text the replacement cannot be located; the error fires at argument parsing, before the file is read.","triggerScenarios":"Thrown at src/openhuman/tools/impl/filesystem/edit_file.rs:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include `old_string` with the exact current text to replace","Ensure old_string matches the file content exactly (whitespace included)"],"exampleFix":null,"handlingStrategy":"validation","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-14T00:17:10.932Z"}