{"record":{"id":"444cd0183db8b371","repo":"tinyhumansai/openhuman","slug":"missing-required-string-argument-contents","errorCode":null,"errorMessage":"missing required string argument `contents`","messagePattern":"missing required string argument `contents`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/config/workspace/tools.rs","lineNumber":105,"sourceCode":"        json!({\n            \"type\": \"object\",\n            \"properties\": {\n                \"filename\": { \"type\": \"string\", \"enum\": [\"SOUL.md\", \"IDENTITY.md\"] },\n                \"contents\": { \"type\": \"string\" }\n            },\n            \"required\": [\"filename\", \"contents\"]\n        })\n    }\n    fn permission_level(&self) -> PermissionLevel {\n        PermissionLevel::Write\n    }\n    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {\n        log::debug!(\"[tool][workspace] update_persona invoked\");\n        let filename = req_str(&args, \"filename\")?;\n        let contents = args\n            .get(\"contents\")\n            .and_then(Value::as_str)\n            .ok_or_else(|| anyhow::anyhow!(\"missing required string argument `contents`\"))?;\n        let outcome = rpc::write_workspace_file(&self.config.workspace_dir, &filename, contents)\n            .map_err(|e| anyhow::anyhow!(\"workspace_update_persona: {e}\"))?;\n        Ok(ToolResult::success(serde_json::to_string(&outcome.value)?))\n    }\n}\n\n/// Reset a persona file to its bundled default. Default-OFF.\npub struct WorkspaceResetPersonaTool {\n    config: Arc<Config>,\n}\nimpl WorkspaceResetPersonaTool {\n    pub fn new(config: Arc<Config>) -> Self {\n        Self { config }\n    }\n}\n#[async_trait]\nimpl Tool for WorkspaceResetPersonaTool {\n    fn name(&self) -> &str {","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/config/workspace/tools.rs#L87-L123","documentation":"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.","triggerScenarios":"Thrown at src/openhuman/config/workspace/tools.rs:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the full new file contents as the `contents` string"],"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"}