{"record":{"id":"635881b1e9fc806e","repo":"tinyhumansai/openhuman","slug":"missing-agent-parameter","errorCode":null,"errorMessage":"Missing 'agent' parameter","messagePattern":"Missing 'agent' parameter","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/tools/delegate.rs","lineNumber":126,"sourceCode":"                    \"type\": \"string\",\n                    \"minLength\": 1,\n                    \"description\": \"The task/prompt to send to the sub-agent\"\n                },\n                \"context\": {\n                    \"type\": \"string\",\n                    \"description\": \"Optional context to prepend (e.g. relevant code, prior findings)\"\n                }\n            },\n            \"required\": [\"agent\", \"prompt\"]\n        })\n    }\n\n    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {\n        let agent_name = args\n            .get(\"agent\")\n            .and_then(|v| v.as_str())\n            .map(str::trim)\n            .ok_or_else(|| anyhow::anyhow!(\"Missing 'agent' parameter\"))?;\n\n        if agent_name.is_empty() {\n            return Ok(ToolResult::error(\"'agent' parameter must not be empty\"));\n        }\n\n        let prompt = args\n            .get(\"prompt\")\n            .and_then(|v| v.as_str())\n            .map(str::trim)\n            .ok_or_else(|| anyhow::anyhow!(\"Missing 'prompt' parameter\"))?;\n\n        if prompt.is_empty() {\n            return Ok(ToolResult::error(\"'prompt' parameter must not be empty\"));\n        }\n\n        let context = args\n            .get(\"context\")\n            .and_then(|v| v.as_str())","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/tools/delegate.rs#L108-L144","documentation":"The delegate tool was invoked without an `agent` argument (absent, not a string, or blank after trim). This is a guard on the model's tool-call arguments before any sub-agent dispatch happens; the required keys `agent` and `prompt` are declared in the tool schema, so a well-formed caller never hits it.","triggerScenarios":"Thrown at src/openhuman/agent/tools/delegate.rs:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include an `agent` string parameter naming the sub-agent to delegate to","Use a non-blank agent identifier registered in the agent registry"],"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"}