Hmbown/CodeWhale · error
tool result
Error message
tool result
What it means
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.
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
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at crates/tui/src/image_attach/tests.rs:118 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Hmbown/CodeWhale@433685b202 (2026-09-15).
Data as JSON: /api/errors/cf30495397ec6dd1.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/image_attach/tests.rs:118
content_blocks: Some(vec![serde_json::json!({
"type": "image",
"mime_type": "image/png",
"data": "QUJD",
})]),
}],
}];
assert_eq!(
strip_images_when_unsupported(&mut messages, SupportState::Unsupported, "text-only",),
1
);
let ContentBlock::ToolResult {
content,
content_blocks,
..
} = &messages[0].content[0]
else {
panic!("tool result")
};
assert!(content_blocks.is_none());
assert!(content.contains("text-only"), "{content}");
}
#[test]
fn copy_projection_never_contains_inline_image_bytes() {
const SENTINEL: &str = "U0VOU0lUSVZFX0JBU0U2NA==";
let projected = safe_tool_result_content_blocks(Some(&[serde_json::json!({
"type": "image",
"mime_type": "image/png",
"data": SENTINEL,
})]))
.expect("projection");
let encoded = serde_json::to_string(&projected).expect("json");
assert!(!encoded.contains(SENTINEL), "{encoded}");
assert!(
encoded.contains("inline_or_local_image_payload"),View on GitHub (pinned to 433685b202)