Skip to content

Investigate: turn-complete signal parsing duplicated on both client and server #205

@danshapiro

Description

@danshapiro

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions