Describe the bug
On macOS 15.7.3. the bash tool in GitHub Copilot CLI experiences PTY subsystem corruption leading to complete tool failure after sustained use. The tool exhibits a dual bug: TTY device leakage AND partial cleanup failures resulting in "revoked" file descriptors. After approximately 42 hours of operation with ~150 bash tool calls, all bash commands fail with pty_posix_spawn failed with error: 2 (No such file or directory).
Have experienced this on two successive long-running Copilot CLI sessions.
Affected version
GitHub Copilot CLI 0.0.400.
Steps to reproduce the behavior
- Start Copilot CLI in server mode
- Use bash tool programmatically (via SDK or manual commands)
- Make 100-200+ bash tool invocations over 24-48 hours
- Observe progressive resource accumulation:
- TTY devices leak (1 per invocation)
- File descriptors leak (6+ per invocation)
- "Revoked" FDs accumulate (cleanup failures)
- Memory grows continuously
- Eventually all bash commands fail with:
pty_posix_spawn failed with error: 2
Expected behavior
- PTY devices should be fully released after bash command completes
- No "revoked" file descriptors (cleanup should succeed completely)
- Stable memory usage for CLI process
- Run indefinitely without resource exhaustion
- Graceful degradation if resources become constrained
- Clear error messages (not generic "error: 2")
Additional context
No response