fix(cmux-next): enforce SSH, git, and capture deadlines (#20776)
Summary
A hung SSH process now stops when its deadline expires instead of leaving the caller waiting for the process to exit. Git writes terminate the entire child process group with a SIGTERM grace period and SIGKILL escalation, and failed screencapture exits are reported as failures instead of user cancellation.
The focused regression target covers all three paths with real subprocesses. Fixes #20776.
Testing
Added CmuxNextErrorHandlingTests with coverage for the SSH deadline, git child-process-group cleanup, and non-zero capture exit status.
The local checkout has no Swift/Xcode toolchain (swift test --package-path Packages/macOS/CmuxNext --filter CmuxNextErrorHandlingTests could not start: swift: command not found), so local execution is unverified. Hosted cmux-next checks are required for compilation and execution.
Changelog
Fixed: SSH, git, and screen-capture subprocess failures now honor deadlines and exit status.
Proof
No visual proof: this is subprocess error handling.
Checklist
- Behavior changes have added or updated tests, or Testing says why not
- User-facing docs updated if needed
- Reviewed with a subagent before merge (cmux-review), and all bot and human review comments resolved
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes subprocess deadline and exit-status handling in cmux-next so hung child processes stop instead of leaving callers waiting, and failed subprocess exits report as failures. Fixes #20776.
- SSH processes terminate when their deadline expires; the cancellation reaches the inner await directly.
- Git timeouts signal the entire child process group with SIGTERM, escalating to SIGKILL after a two-second grace period; child processes start in their own group via
posix_spawn, so hooks and filters cannot outlive a timed-out git. screencaptureruns that exit nonzero are reported as failures with a localized error instead of success withcancelled: true.- Adds
CmuxNextErrorHandlingTestscovering all three paths with real subprocesses, and registers it in test route selection and the CI target graph. - Local execution is unverified because the Swift toolchain is unavailable.