Skip to content

Prevent unbounded terminal output buffering in the main process - #334913

Draft
Ulugbek Abdullaev (ulugbekna) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-terminal-pty-output-leak
Draft

Prevent unbounded terminal output buffering in the main process#334913
Ulugbek Abdullaev (ulugbekna) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-terminal-pty-output-leak

Conversation

Copilot AI commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

localPty eagerly buffers terminal events that renderers consume through a direct pty-host MessagePort instead. Those buffers never drain, causing output-proportional main-process heap growth and eventual OOM.

  • Stop retention: Mark all seven per-process events unbuffered on localPty, using a typed shared event list.
  • Preserve behavior: Keep buffering for the five onPtyHost* events; leave direct-channel delivery and global IPC semantics unchanged.
  • Regression coverage: Check lazy subscription, live delivery, unsubscribe/resubscribe behavior, and preserved host-event buffering.

Copilot AI balanced review requested due to automatic review settings September 7, 2026 13:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Co-authored-by: ulugbekna <16353531+ulugbekna@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix main process leaks from terminal PTY output Prevent unbounded terminal output buffering in the main process Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants