{"record":{"id":"cf30495397ec6dd1","repo":"Hmbown/CodeWhale","slug":"tool-result","errorCode":null,"errorMessage":"tool result","messagePattern":"tool result","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/image_attach/tests.rs","lineNumber":118,"sourceCode":"            content_blocks: Some(vec![serde_json::json!({\n                \"type\": \"image\",\n                \"mime_type\": \"image/png\",\n                \"data\": \"QUJD\",\n            })]),\n        }],\n    }];\n\n    assert_eq!(\n        strip_images_when_unsupported(&mut messages, SupportState::Unsupported, \"text-only\",),\n        1\n    );\n    let ContentBlock::ToolResult {\n        content,\n        content_blocks,\n        ..\n    } = &messages[0].content[0]\n    else {\n        panic!(\"tool result\")\n    };\n    assert!(content_blocks.is_none());\n    assert!(content.contains(\"text-only\"), \"{content}\");\n}\n\n#[test]\nfn copy_projection_never_contains_inline_image_bytes() {\n    const SENTINEL: &str = \"U0VOU0lUSVZFX0JBU0U2NA==\";\n    let projected = safe_tool_result_content_blocks(Some(&[serde_json::json!({\n        \"type\": \"image\",\n        \"mime_type\": \"image/png\",\n        \"data\": SENTINEL,\n    })]))\n    .expect(\"projection\");\n    let encoded = serde_json::to_string(&projected).expect(\"json\");\n    assert!(!encoded.contains(SENTINEL), \"{encoded}\");\n    assert!(\n        encoded.contains(\"inline_or_local_image_payload\"),","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/crates/tui/src/image_attach/tests.rs#L100-L136","documentation":"let-else panic message in the test blind_route_removes_nested_tool_result_image: after strip_images_when_unsupported ran, the first content block was expected to be a ToolResult (image blocks stripped), but it was not, so the else branch panics. It indicates the stripping pass changed or did not preserve the message structure the blind routing path relies on.","triggerScenarios":"Thrown at crates/tui/src/image_attach/tests.rs:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Print the actual first content block to see what strip_images_when_unsupported produced","Check that the Unsupported-path stripping removes content_blocks but keeps the ToolResult block intact","Re-run against SupportState::Unsupported with the text-only hint as the test does"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}