{"record":{"id":"b8e8383e518fc89b","repo":"tinyhumansai/openhuman","slug":"invalid-approvalmode-other-expected-required","errorCode":null,"errorMessage":"invalid approvalMode '{other}' (expected required|not_required|null)","messagePattern":"invalid approvalMode '(.+?)' \\(expected required\\|not_required\\|null\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/tools/todo.rs","lineNumber":258,"sourceCode":"\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    };\n    let approval_mode = match args.get(\"approvalMode\") {\n        Some(value) if value.is_null() => Some(None),\n        Some(value) => match value.as_str() {\n            Some(\"required\") => Some(Some(TaskApprovalMode::Required)),\n            Some(\"not_required\") => Some(Some(TaskApprovalMode::NotRequired)),\n            Some(other) => {\n                return Err(anyhow::anyhow!(\n                    \"invalid approvalMode '{other}' (expected required|not_required|null)\"\n                ))\n            }\n            None => {\n                return Err(anyhow::anyhow!(\n                    \"invalid approvalMode type (expected required|not_required|null)\"\n                ))\n            }\n        },\n        None => None,\n    };\n    Ok(CardPatch {\n        content: None,\n        status,\n        objective: optional_string(args, \"objective\"),\n        plan: optional_string_array(args, \"plan\")?,\n        assigned_agent: optional_string(args, \"assignedAgent\"),\n        allowed_tools: optional_string_array(args, \"allowedTools\")?,","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/tools/todo.rs#L240-L276","documentation":"The todo tool received an `approvalMode` whose string value is neither `required` nor `not_required`. Parsed inside patch_from_args while building a CardPatch; null is accepted as an explicit clear, so only unrecognized non-null strings reach this error.","triggerScenarios":"Thrown at src/openhuman/agent/tools/todo.rs:258 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use \"required\", \"not_required\", or null for approvalMode"],"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"}