Hmbown/CodeWhale · error · anyhow::Error

Sub-agent requested unavailable tools: {}

Error message

Sub-agent requested unavailable tools: {}

What it means

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.

Source

Thrown at crates/tui/src/tools/subagent/mod.rs:11020

        agent_type.clone(),
        agent_id.clone(),
        assignment
            .role
            .as_deref()
            .filter(|role| !role.trim().is_empty())
            .unwrap_or(agent_type.as_str())
            .to_string(),
        allowed_tools.clone(),
        // This agent's own list, allocated by `child_runtime()` (#4810). It is
        // writable by this agent alone: neither the parent nor a sibling holds
        // this `Arc`, so `work_update` here cannot reach the parent's Work
        // checklist or work graph.
        runtime.todos.clone(),
        Arc::new(Mutex::new(PlanState::default())),
    );
    let unavailable_tools = tool_registry.unavailable_allowed_tools();
    if !unavailable_tools.is_empty() {
        return Err(anyhow!(
            "Sub-agent requested unavailable tools: {}",
            unavailable_tools.join(", ")
        ));
    }
    let tool_catalog = tool_registry.deferred_catalog_for_model(&agent_type);
    let mut tool_surface = SubAgentToolSurface::new(tool_catalog, &[]);
    if let Some(mb) = runtime.mailbox.as_ref() {
        let _ = mb.send(MailboxMessage::started(&agent_id, agent_type.clone()));
    }
    record_agent_progress(
        runtime,
        &agent_id,
        AgentProgressEventMeta::new(AgentWorkerStatus::Starting),
        format!("started ({})", agent_type.as_str()),
    );

    let mut steps = 0;
    let mut final_result: Option<String> = None;

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Remove or correct the unavailable tool names listed in the error
  2. Check the agent type's supported tools and role restrictions
  3. Use tool_search/hydration-supported names or a role that grants the requested tools
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/tui/src/tools/subagent/mod.rs:11020 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/936317f95b657c04. Report an issue: GitHub.