SSH断开后ACP代理无法恢复
作者: treuherz创建于 2026年7月1日更新于 2026年9月17日
标签state:needs triage
重现步骤
- 在 Zed 中打开远程项目
- 打开代理线程,开始聊天(我使用了 Claude Code、OpenCode 和 Hermes)
- 强制 SSH 连接失败(例如,从客户端机器执行
pkill ssh) - 代理线程消失,出现红色错误。"启动失败"/"服务器以退出状态 255 退出"
- 尝试恢复代理!
- 转到代理设置面板,发现 Claude Code 旁边有一个绿色圆点,尽管出现了错误
- 单击重连图标,等待它"成功"
- 返回到代理线程,仍然处于死状态,出现新的错误:"启动失败"/"内部错误: '发送失败,因为接收器已消失'"
- 尝试创建新的代理线程,没有任何变化。
执行
pkill ssh是强制这种情况的最简单方法,但当我以任何其他原因断开连接时,例如短暂锁定我的笔记本电脑或切换网络时,也会发生同样的事情。 我找到的唯一恢复方法是使用workspace: reload操作,或者有时,在上述步骤 5 中重新连接代理后,选择一个 Zed 尚未将其归类为死的较旧代理线程。
当前行为与预期行为之间的差异
- 代理线程在重新连接到远程后应该自动重连。Zed 应重启 ACP 服务并恢复会话(如果需要),而不是立即向用户显示错误。
- 从设置中重新连接 ACP 服务不会使该代理的线程处于死状态。
- 在成功重新连接到 ACP 服务后,创建新的代理线程不会失败。
Zed 版本和系统规格
Zed: v1.8.2+stable.314.5e33fc855f6fe58dd82ed6acb1f58034c3fb6bac (Zed) OS: macOS 15.3.1 内存: 24 GiB 架构: aarch64
日志 ``` 2026-07-01T17:01:15+01:00 WARN [remote::remote_client] remote heartbeat: connection activity channel has been dropped. stopping. 2026-07-01T17:01:15+01:00 ERROR [remote::remote_client] proxy process terminated unexpectedly: 255 2026-07-01T17:01:15+01:00 INFO [remote::remote_client] setting state to 'reconnecting' 2026-07-01T17:01:15+01:00 INFO [remote::remote_client] Trying to reconnect to remote server... Attempt 1 2026-07-01T17:01:17+01:00 INFO [remote::transport::ssh] Remote is windows: false 2026-07-01T17:01:17+01:00 INFO [remote::transport::ssh] Remote shell discovered: /bin/zsh 2026-07-01T17:01:17+01:00 INFO [remote::transport::ssh] Remote platform discovered: RemotePlatform { os: Linux, arch: X86_64 } 2026-07-01T17:01:18+01:00 WARN [remote_server] (remote server) stdin read failed: unexpected end of file 2026-07-01T17:01:18+01:00 WARN [remote_server] (remote server) error reading message on stdin, dropping connection. 2026-07-01T17:01:18+01:00 INFO [remote_server] (remote server) accepting new connections 2026-07-01T17:01:18+01:00 INFO [remote_server] (remote server) accepted new connections 2026-07-01T17:01:18+01:00 INFO [remote::remote_client] Successfully reconnected …内容来源: zed-industries/zed