Skip to content

fix(tui): reap PTY child on startup failure - #11414

Merged
lawrencecchen merged 2 commits into
mainfrom
wave190-pty-startup
Sep 2, 2026
Merged

lawrencecchen merged 2 commits into
mainfrom
wave190-pty-startup

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • keep local PTY children owned through fallible startup setup
  • kill and wait when setup or reaper-thread creation fails
  • avoid a second kill after a successful wait

Verification

  • rustfmt and git diff --check
  • hosted cmux-tui verification follows after PR creation

This change is limited to local PTY startup in cmux-tui-core/src/surface.rs; terminal-host runtime is unchanged.


Summary by cubic

Fixes a PTY child process leak where a spawned child stayed alive if local terminal startup failed after spawn. Terminal-host runtime is unchanged.

  • A startup guard now kills and reaps the child on any failure path and tracks whether the wait already reaped it to avoid a second kill against a reused PID.
  • Reaper-thread creation failure now closes the ConPTY master before returning so reader and frame threads can release the surface.

Written for commit 50ce113. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cmux166 Ready Ready Preview Sep 2, 2026 3:08pm UTC
cmux41 Ready Ready Preview Sep 2, 2026 3:08pm UTC

@coderabbitai

coderabbitai Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 2d50c273-c28b-4139-8a07-b2ffc7a7142d

📥 Commits

Reviewing files that changed from the base of the PR and between 0247f51 and 50ce113.

📒 Files selected for processing (2)
  • cmux-tui/crates/cmux-tui-core/src/surface.rs
  • cmux-tui/crates/cmux-tui-core/src/terminal_host_protocol.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

Deployment failed for project cmux166 with the following error:

Resource is limited - try again in 60 minutes (more than 450, code: "api-deployments-paid-per-hour").

Learn More: https://vercel.com/manaflow?upgradeToPro=build-rate-limit

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

Deployment failed for project cmux41 with the following error:

Resource is limited - try again in 60 minutes (more than 450, code: "api-deployments-paid-per-hour").

Learn More: https://vercel.com/manaflow?upgradeToPro=build-rate-limit

@lawrencecchen
lawrencecchen force-pushed the wave190-pty-startup branch 2 times, most recently from 997794d to 701f1ed Compare September 1, 2026 11:23
@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@cursor

cursor Bot commented Sep 2, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@lawrencecchen
lawrencecchen merged commit 6a5dd4d into main Sep 2, 2026
41 checks passed
rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 2, 2026
436fc1f Add unified surface selection context API (manaflow-ai#10022)
d028302 Merge pull request manaflow-ai#11696 from manaflow-ai/audit-tui-graphics-diff-wave202
11af2f2 perf(cmux-tui): index graphics pointer routes
60d06c2 Merge pull request manaflow-ai#11687 from manaflow-ai/feat-config-key-dispatch-complexity
0358c30 Merge pull request manaflow-ai#11684 from manaflow-ai/feat-tui-tab-scroll-range-fit
2c0c8a4 test(cmux-tui): bound graphics diff comparisons
8187531 Merge pull request manaflow-ai#11672 from manaflow-ai/issue-remote-tree-cache-race
f0ff9cf Merge pull request manaflow-ai#11630 from manaflow-ai/feat-journal-group-commit
f1e2d3f perf(tui): cache key dispatch maps
96897a7 test(tui): cover cached key dispatch refresh
e40f6ca fix tab scroll range fitting complexity
275cf7c test tab scroll range fitting at scale
995638d Merge pull request manaflow-ai#11640 from manaflow-ai/feat-tui-worker-cancellation
790b53f perf(tui): avoid pane area frame clone (manaflow-ai#11404)
6a5dd4d fix(tui): reap PTY child on startup failure (manaflow-ai#11414)
2ebb5a5 fix(tui): clear stale agent updates at snapshot boundary
3b91c0c test(tui): prevent stale agent resurrection after omission
789b350 fix(tui): retain agent updates across topology races
85cbff1 test(tui): retain agent updates across topology omission
586a2a6 perf(cmux-tui): resolve resource selectors without the registry lock
7fb5414 fix(cmux-tui): cancel blocked machine worker sends
dd7347e test(cmux-tui): cover cancellable machine completion send

This branch was successfully deployed

2 active deployments
Preview – cmux166 — 50ce113a Deployed Sep 2, 2026 by vercel[bot]
Preview – cmux41 — 50ce113a Deployed Sep 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant