pub fn format_compact_summary(raw: &str) -> StringExpand description
Strip the <analysis>…</analysis> drafting scratchpad from the model’s
response and convert <summary>…</summary> into readable section headers.
Returns the cleaned summary.
Processing steps:
- Remove the first
<analysis>…</analysis>block (non-greedy). - If
<summary>…</summary>is present, replace the whole match withSummary:\n<content trimmed>. - Collapse 3+ consecutive newlines to 2.
- Trim whitespace.
- If neither tag is present, return
raw.trim()unchanged (graceful degradation for models that ignore the template).