{"record":{"id":"3a1db28ecc62474c","repo":"Hmbown/CodeWhale","slug":"tool-name-is-not-in-this-child-s-policy-filtered","errorCode":null,"errorMessage":"Tool {name} is not in this child's policy-filtered catalog","messagePattern":"Tool (.+?) is not in this child's policy-filtered catalog","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/subagent/mod.rs","lineNumber":18129,"sourceCode":"        name: &str,\n        input: Value,\n    ) -> Result<RichToolResult> {\n        if is_tool_search_tool(name) {\n            if !request_active_names.contains(name) {\n                return Err(anyhow!(\"Tool {name} is not in this child's catalog\"));\n            }\n            return surface\n                .search(name, &input)\n                .map(|content| RichToolResult::plain(ToolResult::success(content)));\n        }\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,","sourceCodeStart":18111,"sourceCodeEnd":18147,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/tools/subagent/mod.rs#L18111-L18147","documentation":"When dispatching a non-tool_search call, the child looks up the named tool in the policy-filtered surface catalog to learn whether it is deferred. If the tool is not present in the catalog at all, this error is returned — the child's policy filtered it out or it simply is not part of this child's tool surface. Only tools present in the catalog can be dispatched, and deferred ones must additionally be hydrated (active) first.","triggerScenarios":"A sub-agent invoking a tool name that does not appear in its policy-filtered catalog — the name was filtered out by the child's allow/deny policy, belongs to the parent but not the child, or is misspelled/renamed.","commonSituations":"A model guessing at tool names it saw in the parent's system prompt but not in the child's catalog; policy changes (deny rules, agent-type defaults) removing a tool mid-session; version drift renaming tools between catalog construction and dispatch.","solutions":["Retry with a tool name that is listed in the child's visible tool catalog","Fix the child's policy/allow-list so the needed tool is included in its catalog","Check for tool renames between versions and use the current name","If the tool is deferred but present, it must be activated via tool_search first — a different error path than this one"],"exampleFix":"// before: child calls a parent-only tool\n{\"name\": \"deploy\", ...}   // not in child's catalog\n// after: child uses its own catalog tool and reports back\n{\"name\": \"read\", \"input\": {\"path\": \"deploy/plan.md\"}}","handlingStrategy":"type-guard","validationCode":"let in_catalog = child.catalog.iter().any(|t| t.name == name);\nif !in_catalog {\n    return Err(format!(\"{name} is not available to this child\"));\n}","typeGuard":"fn tool_in_catalog(child: &SubAgent, name: &str) -> bool {\n    child.catalog.iter().any(|t| t.name == name)\n}","tryCatchPattern":"match child.call_tool(name, input) {\n    Err(e) if e.to_string().contains(\"policy-filtered catalog\") =>\n        Err(anyhow!(\"{name} is not part of this child's tool surface; use a listed tool\")),\n    other => other,\n}","preventionTips":["Derive the model's tool list only from the child's own catalog, never the parent's","Review allow/deny policy when a child reports missing tools","Check for tool renames after version upgrades"],"tags":["subagent","tools","catalog","policy"],"backgroundTag":"resource-not-found","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}