Repository navigation
fix: exclude unowned same-TTY processes from memory attribution - #16559
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Require cmux process-tree, scope, descendant, or process-group evidence before charging TTY processes to a surface. Report collisions separately while preserving reparented scoped helpers and WebKit roots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. Review configuration: ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (5)
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. Comment |
|
All contributors have signed the CLA ✍️ ✅ |
There was a problem hiding this comment.
All reported issues were addressed across 5 files
You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
CI failure attributionCI failed on
Matched log linesNot re-run automatically: Written by |
|
Merge receipt for
Labeled |
abdf121 fix: exclude unowned same-TTY processes from memory attribution (manaflow-ai#16559) 075dbef test: fix remote paste test failures on main from manaflow-ai#16523 (manaflow-ai#16596) 7d7a9d1 Stop US key positions from hijacking shortcuts on non-US layouts (manaflow-ai#16237) 134c9d9 Let AppKit cycle windows with the System Settings shortcut on ISO keyboards (manaflow-ai#16238) d0dd457 iOS: prevent toolbar flash when switching primary tabs (manaflow-ai#15712) 6c4b727 test(cloud): re-enable the Cloud header width tests by measuring each row (manaflow-ai#16590) 51b60f3 fix(remote): keep reconnect cleanup fixture process-free (manaflow-ai#16586) 6090053 fix(ci): reserve only queued release slots (manaflow-ai#16588) 0440a5d fix: make browser import hint cover all supported browsers (manaflow-ai#16483)
A detached process can retain a terminal's controlling TTY after being reparented to PID 1.
v2AnnotateTopSurfacetreated every same-TTY PID as a root, so an unrelated REPL or daemon inflated cmux and workspace memory totals.This PR requires positive ownership evidence before charging a TTY process to a surface. It preserves explicit cmux-scoped helpers, descendants, process-group members, and shells launched by cmux-owned app processes. Same-TTY collisions are reported in
unattributed_tty_process_pidsandunattributed_resources.The regression fixture covers a detached PPID-1 process, a foreign off-TTY parent, a reparented scoped helper, and a background process group. Existing launchd-parented WebKit attribution remains covered by
CmuxTopSnapshotScopeTests.Commits are intentionally ordered so the first commit adds the failing regression test and the second commit adds the fix. Based on the earlier outside-contributor implementation in #11869, rebased onto current main and tightened around cmux launch evidence.
Validation completed:
./scripts/sync-test-wiring --checkpython3 scripts/check-package-resolved-policy.pypython3 scripts/check-workspace-package-groups.py --checkgit diff --checkand conflict-marker scanFixes #11004
— Cattail g1 🔸
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes memory attribution so detached processes that keep a surface's TTY after being reparented to PID 1 no longer inflate cmux and workspace totals. Previously every same-TTY process was treated as a root; now attribution requires positive ownership evidence via cmux process scope, the cmux-scoped process tree, a descendant, or a process-group relationship. Same-TTY collisions are reported separately in
unattributed_tty_process_pidsandunattributed_resources, while explicit cmux-scoped helpers and launchd-parented WebKit processes stay attributed. Adds regression coverage for detached, foreign-parent, reparented-scoped, and background-process-group cases. Fixes #11004.Written for commit 824b293. Summary will update on new commits.