Skip to content

refactor(@angular/cli): implement native stream line-buffering & VT removal for MCP logs#33210

Open
clydin wants to merge 1 commit into
angular:mainfrom
clydin:feat/mcp-stream-line-buffering
Open

refactor(@angular/cli): implement native stream line-buffering & VT removal for MCP logs#33210
clydin wants to merge 1 commit into
angular:mainfrom
clydin:feat/mcp-stream-line-buffering

Conversation

@clydin
Copy link
Copy Markdown
Member

@clydin clydin commented May 18, 2026

Refactor the process log capturing mechanism in host.ts and devserver.ts to natively line-buffer and sanitize process stdout and stderr streams using Node's native readline createInterface API and util.stripVTControlCharacters. This ensures all command and devserver logs are cleanly line-split, trimmed, and stripped of VT/ANSI color sequences and carriage.

@clydin clydin added the target: rc This PR is targeted for the next release-candidate label May 18, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors log handling in the MCP devserver and host by replacing raw stream data listeners with the node:readline interface for line-by-line processing. The changes include stripping VT control characters and trimming log lines. Corresponding updates were made to the test suite to include line terminators in mock data. Review feedback suggests deduplicating the stream processing logic, removing redundant carriage return replacements already handled by readline, and using .trimEnd() instead of .trim() to preserve important log indentation.

Comment thread packages/angular/cli/src/commands/mcp/devserver.ts Outdated
Comment thread packages/angular/cli/src/commands/mcp/host.ts Outdated
…emoval for MCP logs

Refactor the process log capturing mechanism in host.ts and devserver.ts to natively line-buffer and sanitize process stdout and stderr streams using Node's native readline `createInterface` API and `util.stripVTControlCharacters`. This ensures all command and devserver logs are cleanly line-split, trimmed, and stripped of VT/ANSI color sequences and carriage returns.
@clydin clydin force-pushed the feat/mcp-stream-line-buffering branch from 254808a to 0a42691 Compare May 18, 2026 14:46
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label May 18, 2026
@clydin clydin requested a review from alan-agius4 May 18, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/cli target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant