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 | path, _ := call.Arguments["path"].(string) |
| 282 | return "▶ read_file: " + path |
| 283 | default: |
| 284 | // Fall back to the first non-empty string arg. |
| 285 | for _, v := range call.Arguments { |
| 286 | if s, ok := v.(string); ok && s != "" { |
| 287 | return fmt.Sprintf("▶ %s: %s", call.Name, firstLine(s)) |
| 288 | } |
| 289 | } |
| 290 | return "▶ " + call.Name |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | // bashOutputHead / bashOutputTail bound what headTailBuffer retains: first 1MB |
| 295 | // plus last 1MB of combined output. Far above ctx.Truncate's ~24KB relevance |
| 296 | // threshold (nothing the model would ever see is dropped), small enough that a |
| 297 | // firehose command can't OOM the process. |