{"record":{"id":"35bd73f5f666d940","repo":"tinyhumansai/openhuman","slug":"missing-required-field-key","errorCode":null,"errorMessage":"missing required field `{key}`","messagePattern":"missing required field `(.+?)`","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/tools/todo.rs","lineNumber":233,"sourceCode":"        return BoardLocation::Thread {\n            workspace_dir: parent.workspace_dir.clone(),\n            thread_id: ops::ORCHESTRATOR_TASKS_THREAD_ID.to_string(),\n        };\n    }\n    let Some(thread_id) = thread_context::current_thread_id() else {\n        return BoardLocation::Scratch;\n    };\n    BoardLocation::Thread {\n        workspace_dir: parent.workspace_dir.clone(),\n        thread_id,\n    }\n}\n\nfn required_string(args: &serde_json::Value, key: &str) -> anyhow::Result<String> {\n    let value = args\n        .get(key)\n        .and_then(|v| v.as_str())\n        .ok_or_else(|| anyhow::anyhow!(\"missing required field `{key}`\"))?;\n    let trimmed = value.trim();\n    if trimmed.is_empty() {\n        return Err(anyhow::anyhow!(\"missing required field `{key}`\"));\n    }\n    Ok(trimmed.to_string())\n}\n\nfn optional_string(args: &serde_json::Value, key: &str) -> Option<String> {\n    args.get(key)\n        .and_then(|v| v.as_str())\n        .map(|s| s.to_string())\n}\n\nfn patch_from_args(args: &serde_json::Value) -> anyhow::Result<CardPatch> {\n    let status: Option<TaskCardStatus> = match args.get(\"status\").and_then(|v| v.as_str()) {\n        Some(s) => Some(ops::parse_status(s).map_err(anyhow::Error::msg)?),\n        None => None,\n    };","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/tools/todo.rs#L215-L251","documentation":"Generic required-argument helper for the todo tool: the named key (e.g. `id`, `status`) is absent from the tool args or is not a JSON string. Every required_string call site shares this one message with the key interpolated; it fires before any board operation runs.","triggerScenarios":"Thrown at src/openhuman/agent/tools/todo.rs:233 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include the named key as a non-empty string in the tool arguments","Check the tool's parameter schema for which keys are required per op"],"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-23T08:17:48.524Z"}