mirror of
https://github.com/NCBM/plyngent.git
synced 2026-11-07 07:17:54 +08:00
221d5d5b68
Erasing the in-flight prefix reused a helper that cleared one row more than requested, so a parallel tool batch also erased the line above the prefix - the streamed reasoning text that sits there when a model reasons and then calls tools. The helper now clears exactly the requested rows and takes explicit control of where the cursor lands; the parallel fallback erases its own line and lets the leading newline of the whole-line write reuse it. Row counts are computed from physical terminal rows instead of logical newlines, so an assistant segment wider than the terminal is fully erased before the markdown re-render rather than leaving a stray copy behind. Tests: a byte-level regression for reasoning before a parallel batch, unit coverage for the row-counting and erase primitives, and a wrapped-line flush.