{"record":{"id":"6eaa71e712779c03","repo":"tinyhumansai/openhuman","slug":"missing-edits-array","errorCode":null,"errorMessage":"Missing 'edits' array","messagePattern":"Missing 'edits' array","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/tools/impl/filesystem/apply_patch.rs","lineNumber":101,"sourceCode":"        &self,\n        args: serde_json::Value,\n        _options: ToolCallOptions,\n        context: Option<&ToolExecutionContext>,\n    ) -> anyhow::Result<ToolResult> {\n        self.execute_in_context(args, context).await\n    }\n}\n\nimpl ApplyPatchTool {\n    async fn execute_in_context(\n        &self,\n        args: serde_json::Value,\n        context: Option<&ToolExecutionContext>,\n    ) -> anyhow::Result<ToolResult> {\n        let edits = args\n            .get(\"edits\")\n            .and_then(|v| v.as_array())\n            .ok_or_else(|| anyhow::anyhow!(\"Missing 'edits' array\"))?;\n        if edits.is_empty() {\n            return Ok(ToolResult::error(\"`edits` array is empty\"));\n        }\n        if edits.len() > MAX_EDITS {\n            return Ok(ToolResult::error(format!(\n                \"Too many edits: {} (max {MAX_EDITS})\",\n                edits.len()\n            )));\n        }\n\n        if !self.security.can_act() {\n            return Ok(ToolResult::error(\n                \"[policy-blocked] Action blocked: autonomy is read-only\",\n            ));\n        }\n        if self.security.is_rate_limited() {\n            return Ok(ToolResult::error(\n                \"Rate limit exceeded: too many actions in the last hour\",","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/tools/impl/filesystem/apply_patch.rs#L83-L119","documentation":"Guard in ApplyPatchTool::execute_in_context: the `edits` argument is missing or not a JSON array. The edit list is the tool's core payload; parsing fails before security/path policy is applied to any edit.","triggerScenarios":"Thrown at src/openhuman/tools/impl/filesystem/apply_patch.rs:101 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include `edits` as an array of edit objects","Ensure each edit has path, old_string and new_string fields"],"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"}