github / github/copilot-cli

Bash tool PTY cleanup corruption causes complete failure after sustained use

已關閉
#1,239 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

### 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

1. Start Copilot CLI in server mode
2. Use bash tool programmatically (via SDK or manual commands)
3. Make 100-200+ bash tool invocations over 24-48 hours
4. Observe progressive resource accumulation:
- TTY devices leak (1 per invocation)
- File descriptors leak (6+ per invocation)
- "Revoked" FDs accumulate (cleanup failures)
- Memory grows continuously
5. Eventually all bash commands fail with: `pty_posix_spawn failed with error: 2`

### Expected behavior

1. PTY devices should be fully released after bash command completes
2. No "revoked" file descriptors (cleanup should succeed completely)
3. Stable memory usage for CLI process
4. Run indefinitely without resource exhaustion
5. Graceful degradation if resources become constrained
6. Clear error messages (not generic "error: 2")

### Additional context

_No response_

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。