{"record":{"id":"936317f95b657c04","repo":"Hmbown/CodeWhale","slug":"sub-agent-requested-unavailable-tools","errorCode":null,"errorMessage":"Sub-agent requested unavailable tools: {}","messagePattern":"Sub-agent requested unavailable tools: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/subagent/mod.rs","lineNumber":11020,"sourceCode":"        agent_type.clone(),\n        agent_id.clone(),\n        assignment\n            .role\n            .as_deref()\n            .filter(|role| !role.trim().is_empty())\n            .unwrap_or(agent_type.as_str())\n            .to_string(),\n        allowed_tools.clone(),\n        // This agent's own list, allocated by `child_runtime()` (#4810). It is\n        // writable by this agent alone: neither the parent nor a sibling holds\n        // this `Arc`, so `work_update` here cannot reach the parent's Work\n        // checklist or work graph.\n        runtime.todos.clone(),\n        Arc::new(Mutex::new(PlanState::default())),\n    );\n    let unavailable_tools = tool_registry.unavailable_allowed_tools();\n    if !unavailable_tools.is_empty() {\n        return Err(anyhow!(\n            \"Sub-agent requested unavailable tools: {}\",\n            unavailable_tools.join(\", \")\n        ));\n    }\n    let tool_catalog = tool_registry.deferred_catalog_for_model(&agent_type);\n    let mut tool_surface = SubAgentToolSurface::new(tool_catalog, &[]);\n    if let Some(mb) = runtime.mailbox.as_ref() {\n        let _ = mb.send(MailboxMessage::started(&agent_id, agent_type.clone()));\n    }\n    record_agent_progress(\n        runtime,\n        &agent_id,\n        AgentProgressEventMeta::new(AgentWorkerStatus::Starting),\n        format!(\"started ({})\", agent_type.as_str()),\n    );\n\n    let mut steps = 0;\n    let mut final_result: Option<String> = None;","sourceCodeStart":11002,"sourceCodeEnd":11038,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/tools/subagent/mod.rs#L11002-L11038","documentation":"Validation failure while building a sub-agent's tool surface: the agent's requested tool list contains names that are not available in the runtime's catalog for this agent type. The {} lists the missing tool names; the spawn/assignment is rejected rather than silently dropping tools.","triggerScenarios":"Thrown at crates/tui/src/tools/subagent/mod.rs:11020 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove or correct the unavailable tool names listed in the error","Check the agent type's supported tools and role restrictions","Use tool_search/hydration-supported names or a role that grants the requested tools"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}