You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(call): properly clear wrapped partial transcripts in TTY
The live partial-transcript overwrite in `handleControlMessage` used
`\r` + spaces + `\r` to repaint each partial in place. `\r` only moves
the cursor to column 0 of the *current* terminal row, so when a partial
is long enough to wrap (very common for assistant utterances and any
narrow terminal), only the bottom row of the wrapped block is cleared.
Every previous wrapped row stays on screen, and each subsequent partial
paints another wrapping block on top — producing the duplicated stack
of `🤖 Assistant: ... Seller C` lines reported during a recent
simulated call.
Replace the broken sequence with `readline.cursorTo` /
`readline.clearLine` / `readline.moveCursor` driven by an estimated
display width that accounts for emoji and CJK glyphs being 2 cells
wide. Apply the same clear before printing speech-update,
call-ended, ws.onclose, and SIGINT/SIGTERM cleanup messages so they
don't print over a half-rendered partial.
Also gate live partial overwrites on `process.stdout.isTTY`: when the
output is being piped (CI logs, `tee`, etc.), `\r` was producing
literal carriage returns and concatenated lines. In non-TTY mode we
now skip partials entirely and only print finals — one transcript per
line, clean logs.
No public API change. `tsc --noEmit` and `npm test` (33/33) pass.
0 commit comments