{"record":{"id":"0331a8ccabecc013","repo":"tinyhumansai/openhuman","slug":"section-title-is-required-for-replace-section","errorCode":null,"errorMessage":"'section_title' is required for 'replace_section' action","messagePattern":"'section_title' is required for 'replace_section' action","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/tools/impl/filesystem/update_memory_md.rs","lineNumber":285,"sourceCode":"        let lock = workspace_write_lock(&workspace_dir);\n        let _guard = lock.lock().await;\n        // Also take a cross-process advisory lock so cron subprocesses (which\n        // don't share the in-process mutex above) can't clobber the same file\n        // mid-RMW. Held across read + atomic write; released on drop.\n        let _file_lock = acquire_cross_process_write_lock(&workspace_dir).await?;\n        tracing::debug!(\n            workspace = %workspace_dir.display(),\n            \"[update_memory_md] acquired per-workspace write lock (in-process + cross-process flock)\"\n        );\n\n        match action {\n            \"append\" => self.do_append(&target_path, file, content).await,\n            \"replace_section\" => {\n                let section_title = args\n                    .get(\"section_title\")\n                    .and_then(|v| v.as_str())\n                    .ok_or_else(|| {\n                        anyhow::anyhow!(\"'section_title' is required for 'replace_section' action\")\n                    })?;\n                self.do_replace_section(&target_path, file, section_title, content)\n                    .await\n            }\n            other => Ok(ToolResult::error(format!(\n                \"Unknown action '{other}'. Use 'append' or 'replace_section'.\"\n            ))),\n        }\n    }\n}\n\nimpl UpdateMemoryMdTool {\n    /// Append `content` to the end of `path`, creating the file if it does not exist.\n    async fn do_append(\n        &self,\n        path: &std::path::Path,\n        file: &str,\n        content: &str,","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/tools/impl/filesystem/update_memory_md.rs#L267-L303","documentation":"The 'replace_section' action rewrites one titled section of MEMORY.md/SKILL.md, so it needs 'section_title' to locate the heading. This fires during argument validation after the write locks are acquired but before the file is read, when action=replace_section was given without a section_title string.","triggerScenarios":"Thrown at src/openhuman/tools/impl/filesystem/update_memory_md.rs:285 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add \"section_title\" matching the markdown heading text of the section to replace","Or switch to the append action if appending rather than replacing is intended"],"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"}