-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Opportunity
shared/turn-complete-signal.ts contains extractTurnCompleteSignals(), a stateful ANSI escape sequence parser that strips BEL characters used as turn-complete signals from terminal output. This shared code runs on both the client and the server in the terminal output hot path.
If the server stripped the signals and sent cleaned data plus a separate sideband turn.complete event, the client could skip the parsing entirely — saving CPU on every terminal output chunk for coding CLI modes.
Analysis
Low-medium impact, low complexity. The server's terminal stream broker already handles output chunking. Adding signal extraction there and emitting a sideband event would let the client consume cleaned output directly. Needs investigation to confirm whether the server already does this or if both sides currently parse independently.
Action
Investigate and validate this opportunity. Determine whether both sides actually parse, and if so, determine the right implementation approach following TDD.