{"record":{"id":"f0fc93a820d03b89","repo":"Hmbown/CodeWhale","slug":"configured-web-evidence-tool","errorCode":null,"errorMessage":"configured Web evidence tool","messagePattern":"configured Web evidence tool","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/subagent/tests.rs","lineNumber":7897,"sourceCode":"    );\n    let strict = surface.request_tools(surface.catalog.clone(), true);\n    assert_eq!(\n        strict\n            .iter()\n            .find(|tool| tool.name == \"read\")\n            .and_then(|tool| tool.strict),\n        Some(true)\n    );\n}\n\n#[tokio::test]\nasync fn small_surface_read_only_child_discovers_web_deferred() {\n    let registry = small_surface_registry(FleetRole::Scout);\n    let catalog = registry.deferred_catalog_for_model(&FleetRole::Scout);\n    let web = catalog\n        .iter()\n        .find(|tool| tool.name == \"Web\")\n        .expect(\"configured Web evidence tool\");\n    assert_eq!(web.defer_loading, Some(true));\n    let actions = web.input_schema[\"properties\"][\"action\"][\"enum\"]\n        .as_array()\n        .expect(\"Web action enum\");\n    assert_eq!(actions, &[json!(\"search\"), json!(\"fetch\")]);\n\n    let mut surface = SubAgentToolSurface::new(catalog, &[]);\n    assert!(!model_tool_names(model_request_tools(&mut surface)).contains(\"Web\"));\n    let request_active = surface.active_names.clone();\n    let result = registry\n        .execute_from_surface(\n            \"agent_scout\",\n            \"\",\n            &mut surface,\n            &request_active,\n            TOOL_SEARCH_NAME,\n            json!({\"query\": \"web\", \"match\": \"regex\"}),\n        )","sourceCodeStart":7879,"sourceCodeEnd":7915,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/tools/subagent/tests.rs#L7879-L7915","documentation":"A panic from `.expect(\"configured Web evidence tool\")` in the test `small_surface_read_only_child_discovers_web_deferred`. The test searches the deferred catalog for a Scout-role child and asserts a tool named \"Web\" exists with `defer_loading == Some(true)`; if the configured small-surface profile no longer registers a Web evidence tool, `find` returns `None` and the expect panics. This is a configuration/contract drift between the test fixture and the tool surface configuration.","triggerScenarios":"The Scout small-surface profile stops including a tool named `Web` (renamed tool, changed `small_surface_registry`, or filtering in `deferred_catalog_for_model` removes it), so `catalog.iter().find(|t| t.name == \"Web\")` yields `None`.","commonSituations":"A developer renames or relocates the Web tool in the tool catalog; profile changes exclude Web from read-only children; tool-name case changes (e.g. `web_search`) without updating this assertion.","solutions":["Inspect `small_surface_registry(FleetRole::Scout)` and the profile's tool list to confirm a `Web` tool is registered for Scout","Print the catalog (`dbg!(&catalog.iter().map(|t| t.name.clone()).collect::<Vec<_>>())`) to see which tools actually exist","Update the test's expected tool name if the Web tool was intentionally renamed, or restore the Web registration in the Scout profile if the removal was accidental"],"exampleFix":"// before\n.find(|tool| tool.name == \"Web\")\n.expect(\"configured Web evidence tool\");\n// after (if renamed)\n.find(|tool| tool.name == \"WebSearch\")\n.expect(\"configured WebSearch evidence tool\");","handlingStrategy":"validation","validationCode":"let web = catalog.iter().find(|t| t.name == \"Web\");\nif web.is_none() {\n    panic!(\"Web tool missing from Scout catalog; available: {:?}\",\n        catalog.iter().map(|t| t.name.as_str()).collect::<Vec<_>>());\n}","typeGuard":"fn find_tool<'a>(catalog: &'a [Tool], name: &str) -> Option<&'a Tool> {\n    catalog.iter().find(|t| t.name == name)\n}","tryCatchPattern":"let web = match catalog.iter().find(|t| t.name == \"Web\") {\n    Some(t) => t,\n    None => panic!(\"configured Web evidence tool missing from Scout catalog\"),\n};","preventionTips":["Keep tool names in a shared constant instead of string literals in tests","Add a single source-of-truth test listing expected tools per FleetRole profile","Rename tools via refactoring tools so test literals update together","Review profile config changes against the deferred-catalog contract"],"tags":["rust","test-assertion","tool-catalog","config-drift"],"backgroundTag":"entity-not-found","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T06:17:15.046Z"}