{"record":{"id":"0dbe43ca77dd102f","repo":"tinyhumansai/openhuman","slug":"agent-definition-agent-id-not-found-in-registr","errorCode":null,"errorMessage":"agent definition `{agent_id}` not found in registry","messagePattern":"agent definition `(.+?)` not found in registry","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/triage/escalation.rs","lineNumber":286,"sourceCode":"    if agent_id.starts_with(\"missing-agent-\") {\n        return Err(anyhow!(\n            \"agent definition `{agent_id}` not found in registry\"\n        ));\n    }\n\n    let config = Config::load_or_init()\n        .await\n        .context(\"loading config for sub-agent dispatch\")?;\n\n    let parent_ctx = build_triage_parent(&config, agent_id).await?;\n\n    // `build_root_parent` (inside `build_triage_parent`) guarantees the registry\n    // is initialised, so this lookup for the target definition is safe here.\n    let registry = AgentDefinitionRegistry::global()\n        .ok_or_else(|| anyhow!(\"AgentDefinitionRegistry not initialised\"))?;\n    let definition = registry\n        .get(agent_id)\n        .ok_or_else(|| anyhow!(\"agent definition `{agent_id}` not found in registry\"))?;\n\n    tracing::debug!(\n        agent_id = %agent_id,\n        model = %parent_ctx.model_name,\n        tool_count = parent_ctx.all_tools.len(),\n        \"[triage::escalation] dispatching run_subagent with parent context\"\n    );\n\n    let outcome = with_parent_context(parent_ctx, async {\n        subagent_runner::run_subagent(definition, prompt, SubagentRunOptions::default()).await\n    })\n    .await\n    .map_err(|e| anyhow!(\"run_subagent(`{agent_id}`) failed: {e}\"))?;\n\n    tracing::debug!(\n        agent_id = %agent_id,\n        elapsed_ms = outcome.elapsed.as_millis() as u64,\n        iterations = outcome.iterations,","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/triage/escalation.rs#L268-L304","documentation":"Sub-agent dispatch cannot resolve the requested agent_id to a definition in the global AgentDefinitionRegistry. One site is a deliberate sentinel: ids starting with `missing-agent-` always error here (test/probe path); the other is a real registry miss after the registry was guaranteed initialised — the id names no loaded builtin or TOML-defined agent.","triggerScenarios":"Thrown at src/openhuman/agent/triage/escalation.rs:286 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the agent id is spelled exactly as registered (builtin ids or agent.toml names)","Ensure the agent's definition file is loaded at startup (registry initialisation)","Do not dispatch to removed agents such as the deleted account_admin_agent"],"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"}