Skip to content

fix(acp): recover stalled agent sessions with confirmed restart - #831

Open
dawNotPoi wants to merge 6 commits into
xintaofei:mainfrom
dawNotPoi:fix/acp-stalled-restart
Open

dawNotPoi wants to merge 6 commits into
xintaofei:mainfrom
dawNotPoi:fix/acp-stalled-restart

Conversation

@dawNotPoi

@dawNotPoi dawNotPoi commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Detect a stalled ACP prompt from the last real agent event; keepalive traffic does not reset the 10-minute advisory timer. Suppress the hint while waiting for a user response.
  • Add an explicit restart action on desktop and Web, translated into all 10 locales. Reap only the affected child and wait for its terminal session update before reconnecting to the same external session.
  • Preserve restart ownership across view changes and tab reopen. Reserve teardown atomically against ordinary disconnect and terminal errors; keep uncertain teardown or handshake paths quarantined before allowing a replacement for that session.

A long prompt can be healthy, so restart remains a user decision.

Verification

  • Latest head b954c18c: all seven CI jobs pass across frontend and Rust desktop/server on Linux, macOS, and Windows.
  • Focused final-head checks: restart 15/15, quarantine 3/3, terminal-error 13/13; frontend context/composer 184/184; desktop and server compilation pass.
  • A fake ACP child exercises restart, failed teardown, and reconnect. The two discovered disconnect/terminal-error races have deterministic regression tests and passed independent re-review.

Scope

This adds stall visibility and manual recovery. It does not automatically terminate an agent or change general cancel semantics. Provider compaction behavior remains outside this PR.

Addresses #807.

@dawNotPoi
dawNotPoi marked this pull request as ready for review September 24, 2026 16:39
@dawNotPoi

Copy link
Copy Markdown
Contributor Author

@xintaofei 已转 Ready,请审阅。这个 PR 为 #807 增加可验证的手动恢复:根据 Agent 的实际事件提示长时间静默,不把保活流量当作进展;由用户明确发起重启,只终止对应 ACP 子进程,确认旧进程退出后恢复原 session,桌面和 Web 均支持。独立复审已完成;本地前端 7,788 项测试、Rust server 4,296 项测试通过,最新提交 ecc68b3 的 7 项 CI 全绿。范围是可观察性和手动恢复,不自动判定 Agent 已死亡,也不修改 agy compaction 或通用取消语义。

@dawNotPoi
dawNotPoi marked this pull request as draft September 24, 2026 23:09
@dawNotPoi
dawNotPoi marked this pull request as ready for review September 24, 2026 23:54
@dawNotPoi

Copy link
Copy Markdown
Contributor Author

@xintaofei #831 已根据独立复审修复两处 restart 竞态并转回 Ready:普通断开或终止错误先于重启预留完成时,不会留下阻断同一 session 重连的隔离状态。两个顺序都有确定性回归测试;最新提交 b954c18 的 7 项 CI 全绿,PR 描述已更新。烦请有空审阅。

@dawNotPoi
dawNotPoi force-pushed the fix/acp-stalled-restart branch from b954c18 to ab6ff5d Compare September 28, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant