github / github/copilot-cli

Frequent crashes on WSL2 ARM64: setRawMode EIO kills sessions mid-work

未关闭
#2,379 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:platform-linux area:terminal-rendering
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

## Description

Copilot CLI crashes frequently on WSL2 (Ubuntu 24.04, aarch64) with `setRawMode EIO` errors. The process loses its stdin connection mid-session and shuts down. This is happening multiple times per day — 21 crashes in the past 8 days, with 13 on a single day.

This is distinct from #2088 (React hooks rendering error). The crash signature here is a terminal stdin disconnection, not a rendering bug.

## Environment

- **OS:** Ubuntu 24.04.4 LTS on WSL2
- **Kernel:** 6.6.87.2-microsoft-standard-WSL2
- **Architecture:** aarch64 (ARM64)
- **Terminal:** VS Code Insiders integrated terminal (github.copilot-chat v0.42.2026032703)
- **Node.js:** v18.19.1
- **Copilot CLI:** 1.0.13-1 (installed via `npm install -g @github/copilot`)
- **Shell:** bash

## Crash Signature

From the process logs (`~/.copilot/logs/process-*.log`):

```
2026-03-28T18:20:57.662Z [DEBUG] [shutdown] Starting dispose: InkInstance.rerender
2026-03-28T18:20:57.679Z [DEBUG] Ignoring transient stdin error: setRawMode EIO
2026-03-28T18:20:57.679Z [INFO] Unregistering foreground session: fd8423ed-...
```

The pattern is consistent across all 21 crashes:
1. Session is running normally (often during background agent work or tool calls)
2. `setRawMode EIO` — stdin connection to the terminal is severed
3. Session shuts down, losing all in-progress work

## Frequency

| Date | Crashes |
|------|---------|
| 2026-03-21 | 1 |
| 2026-03-23 | 2 |
| 2026-03-25 | 1 |
| 2026-03-26 | 1 |
| 2026-03-27 | 2 |
| 2026-03-28 | 13 |
| 2026-03-29 | 1 |

The acceleration on Mar 28 correlates with heavier usage (multi-agent workflows with `--agent` flag), but crashes also occur during simple single-agent sessions.

## Reproduction

Not reliably reproducible on demand, but happens consistently during extended sessions (10-60 minutes). More frequent when:
- Using `copilot --agent squad` (custom agent with sub-agent spawning)
- Multiple background tool calls running in parallel
- Sessions lasting >15 minutes

## What I've Tried

- **Version pinning:** Does not work. All npm versions (`@github/copilot@1.0.5` through `@latest`) and all GitHub Release tags (`v1.0.5` through `v1.0.12`) deliver the identical 1.0.13-1 binary. Old binaries are not preserved in the registry.
- **Clean reinstall:** `npm cache clean --force` + `sudo npm install -g @github/copilot@latest` — crashes persist
- **Removing duplicate installs:** Had both curl (`~/.local/bin/copilot`) and npm (`/usr/local/bin/copilot`) — removed curl install, no improvement
- **`--no-auto-update`:** Using this flag to prevent mid-session updates

## Expected Behavior

Sessions should survive stdin interruptions gracefully (reconnect or buffer) rather than terminating. At minimum, the CLI should save session state before shutting down so `--resume` can recover.

## Additional Context

- Related: #2088 (React hooks error, different crash signature but also on WSL2)
- Related: #2217 (CLI resilience to crashes, requests better recovery)
- Context utilization at crash time is typically 5-17% — this is NOT a context overflow issue
- The EIO error suggests the WSL2↔Windows terminal pipe is being dropped, possibly by the VS Code terminal host

贡献指南

打开贡献指南

调研方向

Start with the failure records in ~/.copilot/logs/process-*.log and compare the setRawMode EIO sequence with issues #2088 and #2217. Reproduce extended sessions on WSL2 ARM64, especially with --agent and parallel background tools. Done means stdin interruptions no longer lose the session, or saved state allows --resume recovery.

由索引模型根据 Issue 内容生成。

评估

技术栈
bash, node.js, ubuntu, vscode
领域
cli, developer-experience, operating-systems
Issue 类型
缺陷
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。