pub fn format_protocol_parse_debug_details(raw: &str) -> StringExpand description
Builds one multi-line debug report for a protocol parsing failure.
The report summarizes response sizing, markdown wrapping, JSON parse diagnostics, and any visible top-level keys so schema mismatch errors include enough context to diagnose malformed provider output quickly.
Every line is derived metadata: sizes, parser locations, and key names. No provider payload text is reproduced. Turn errors are rendered into the session transcript, so quoting the payload here would print raw provider output into the chat.