String reassembles head + tail. The in-band seam marker keeps the two halves from reading as contiguous; the accurate size report lives in the caller's end-of-output note (this marker sits at the ~1MB offset, inside the middle ctx.Truncate drops, so the model never reads it).
()
| 281 | // caller's end-of-output note (this marker sits at the ~1MB offset, inside |
| 282 | // the middle ctx.Truncate drops, so the model never reads it). |
| 283 | func (w *headTailBuffer) String() string { |
| 284 | switch { |
| 285 | case w.tailBytes == 0: |
| 286 | return string(w.head) |
| 287 | case w.tailBytes <= int64(len(w.ring)): |
| 288 | return string(w.head) + string(w.ring[:w.tailBytes]) |
| 289 | default: |
| 290 | return string(w.head) + |
| 291 | fmt.Sprintf("\n───── %d bytes OMITTED here (capture cap) ─────\n", w.droppedBytes()) + |
| 292 | string(w.ring[w.pos:]) + string(w.ring[:w.pos]) |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | func firstLine(s string) string { |
| 297 | // IndexAny over both separators, not just '\n', so a CR or CRLF first line |