{"record":{"id":"8b7a57924e183a81","repo":"tinyhumansai/openhuman","slug":"generated-tool-requires-adapter-but-got","errorCode":null,"errorMessage":"generated tool `{}` requires adapter `{}` but got `{}`","messagePattern":"generated tool `(.+?)` requires adapter `(.+?)` but got `(.+?)`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/tools/generated.rs","lineNumber":175,"sourceCode":"        mut definition: GeneratedToolDefinition,\n        adapter: Arc<dyn GeneratedToolAdapter>,\n    ) -> anyhow::Result<Self> {\n        normalize_definition(&mut definition);\n        if let Err(err) = validate_definition(&definition) {\n            log::debug!(\n                \"[generated_tools] definition validation failed tool_name={} error={err}\",\n                definition.name\n            );\n            return Err(err);\n        }\n        if adapter.id() != definition.adapter_id {\n            log::debug!(\n                \"[generated_tools] adapter mismatch tool_name={} required_adapter={} actual_adapter={}\",\n                definition.name,\n                definition.adapter_id,\n                adapter.id()\n            );\n            anyhow::bail!(\n                \"generated tool `{}` requires adapter `{}` but got `{}`\",\n                definition.name,\n                definition.adapter_id,\n                adapter.id()\n            );\n        }\n        Ok(Self {\n            definition,\n            adapter,\n        })\n    }\n\n    /// Borrow the normalized generated tool definition.\n    pub fn definition(&self) -> &GeneratedToolDefinition {\n        &self.definition\n    }\n}\n","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/tools/generated.rs#L157-L193","documentation":"GeneratedTool::new rejects the pair (definition, adapter) when the adapter's id does not equal definition.adapter_id. The adapter is what executes the generated tool, so a mismatch would mean the tool advertises behavior its executor cannot provide; the definition is rejected at registration rather than failing at call time.","triggerScenarios":"Thrown at src/openhuman/tools/generated.rs:175 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Register the tool with the adapter whose id matches definition.adapter_id.","Fix the adapter_id in the generated definition to name the adapter actually being used.","Check the capability/adapter resolution step that produced the pair."],"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-14T05:17:10.506Z"}