{"record":{"id":"9e472b73f8e6f204","repo":"Hmbown/CodeWhale","slug":"tool-name-is-not-active-for-this-sub-agent","errorCode":null,"errorMessage":"Tool {name} is not active for this sub-agent","messagePattern":"Tool (.+?) is not active for this sub-agent","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/subagent/mod.rs","lineNumber":14927,"sourceCode":"        }\n\n        let Some(deferred) = surface\n            .catalog\n            .iter()\n            .find(|tool| tool.name == name)\n            .map(|tool| tool.defer_loading.unwrap_or(false))\n        else {\n            return Err(anyhow!(\n                \"Tool {name} is not in this child's policy-filtered catalog\"\n            ));\n        };\n        if deferred && !request_active_names.contains(name) {\n            return surface\n                .hydrate(name)\n                .map(|content| RichToolResult::plain(ToolResult::success(content)));\n        }\n        if !request_active_names.contains(name) {\n            return Err(anyhow!(\"Tool {name} is not active for this sub-agent\"));\n        }\n        let result = self.execute_full(agent_id, tool_id, name, input).await;\n        if deferred && result.is_ok() {\n            touch_cached_tool_after_execution(\n                &surface.catalog,\n                &mut surface.active_names,\n                &mut surface.cache,\n                name,\n            );\n        }\n        result\n    }\n}\n\nfn is_unbounded_shell_run(name: &str, input: &Value) -> bool {\n    canonical_action_alias(name, input) == \"exec_shell\"\n}\n","sourceCodeStart":14909,"sourceCodeEnd":14945,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/tools/subagent/mod.rs#L14909-L14945","documentation":"Activation guard in execute_from_surface: the tool exists in the catalog and is not deferred, but its name is absent from request_active_names — the per-request activated set. The child uses bounded tool activation, so a catalog tool that was never activated (or was evicted) cannot execute directly.","triggerScenarios":"Thrown at crates/tui/src/tools/subagent/mod.rs:14927 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Activate the tool first via tool_search/hydration in the same request","Narrow the active tool set so the needed tool is not evicted","Retry the call after successful activation"],"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"}