fix(agent-teams): keep a stopped team stopped and wake members after any failure (#1446)

* fix(agent-teams): keep a stopped team stopped and wake members after any failure

Stop killed every member, but the lead kept polling its mailbox: reports
sent before the Stop started hidden lead turns, and a single SendMessage
from one of them unpaused the whole team. Stop now sends team_plan_pause
so the lead holds teammate mail until the user's next message, and the
server only lets lead instructions written after that message resume the
team. A restart in flight when Stop arrives is stopped as well, and the
idle Stop button hides once every member is stopped.

Members that stopped on a usage limit, billing, network or crash failure
were only resumed if the lead happened to message them. The user's next
message now lists every stopped member with its failure and open tasks,
once per failure, whether or not Stop was pressed.

* feat(desktop): show where each team member stands on its tasks

A member that stopped or failed left its task reading "In progress" with
an animated bar, and its card said only "Stopped" or "Error". Tasks whose
owner stopped, failed or waits to retry now show that state without
animation, and the card says which task the member stopped on.

The member card chips tell done, current and next tasks apart, with the
subject on hover. The member drawer groups tasks into now, up next and
done, names the unfinished dependencies of blocked work, shows done as
3/5, and no longer prints +0:00 for a duration polling could not measure.
This commit is contained in:
程序员阿江-Relakkes
2026-10-04 19:31:10 +08:00
committed by GitHub
parent 5dc59c5892
commit 9623064b15
22 changed files with 843 additions and 126 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ Claude 每完成一轮并修改文件,对话里会出现一张「{n} 个文件
后台跑的子 Agent 的工具活动也会冒泡到这里,不用等它跑完才知道它在干什么。
团队成员遇到模型服务断流、限流、5xx 这类临时故障会自己重试,成员行显示「自动重试 2/5」,不用你或主控介入;重试用完,或者遇到需要你处理的错误(比如 API Key 失效),成员行显示「出错」并通知主控。按停止按钮会让整组成员一起停下,但进度不会丢:你下一次给主控发消息时,它会知道哪些成员停在了哪个任务上,再按你的意思决定要不要让它们继续;你也可以直接给某个成员发消息,它会从保存的对话接着干,显示「已停止」的成员也一样。切换模型或权限模式不会打断团队;重启应用后团队还在,给成员发消息即可继续。删除会话或执行 `/clear` 才会结束团队。
团队成员遇到模型服务断流、限流、5xx 这类临时故障会自己重试,成员行显示「自动重试 2/5」,不用你或主控介入;重试用完,或者遇到需要你处理的错误(比如 API Key 失效、余额不足、订阅额度用完),成员行显示「出错」并通知主控。问题解决后给主控发一句「继续」就行:它会收到出错成员的清单,逐个唤醒它们从保存的对话接着干,不会重做已完成的部分。按停止按钮会让整组成员一起停下,主控也不会再自己处理成员发来的汇报,但进度不会丢:你下一次给主控发消息时,它会知道哪些成员停在了哪个任务上,再按你的意思决定要不要让它们继续;你也可以直接给某个成员发消息,它会从保存的对话接着干,显示「已停止」的成员也一样。切换模型或权限模式不会打断团队;重启应用后团队还在,给成员发消息即可继续。删除会话或执行 `/clear` 才会结束团队。
## 轨迹:每一步到底发生了什么
+1 -1
View File
@@ -107,7 +107,7 @@ The first button on the right of the tab bar opens the Activity panel, which lis
Tool activity from background subagents bubbles up here too, so you don't have to wait for one to finish to see what it's doing.
Team members retry on their own when the model service drops a stream, rate-limits, or returns a 5xx; the member row shows "Auto-retry 2/5" and neither you nor the lead has to step in. When the retries run out, or the error needs you (an expired API key, say), the row shows "Error" and the lead is told. The Stop button halts the whole team without losing progress: your next message to the lead tells it which members stopped on which tasks, and it decides from your words whether they carry on. You can also message a member directly; it picks up from its saved conversation, and the same goes for a member marked "Stopped". Switching the model or permission mode doesn't interrupt the team, and after an app restart the team is still there — message a member to continue. Deleting the session or running `/clear` ends the team.
Team members retry on their own when the model service drops a stream, rate-limits, or returns a 5xx; the member row shows "Auto-retry 2/5" and neither you nor the lead has to step in. When the retries run out, or the error needs you (an expired API key, an empty balance, a used-up subscription limit), the row shows "Error" and the lead is told. Once the problem is fixed, tell the lead to continue: it gets the list of members that stopped on an error and wakes each one, which picks up from its saved conversation without redoing finished work. The Stop button halts the whole team, and the lead stops acting on its members' reports, without losing progress: your next message to the lead tells it which members stopped on which tasks, and it decides from your words whether they carry on. You can also message a member directly; it picks up from its saved conversation, and the same goes for a member marked "Stopped". Switching the model or permission mode doesn't interrupt the team, and after an app restart the team is still there — message a member to continue. Deleting the session or running `/clear` ends the team.
## Trajectory: what actually happened, step by step