feat(workflow): kill 整个 workflow 后立即回主 chat

run_done→store→notifications.ts 的通知路径已有,但 confirmYes 后面板继续
挂着挡住主 chat,用户看不到"已停止"反馈。kill 后调 onDone() 立即退出面板,
让主 chat 的 `Workflow "<name>" was stopped` 通知直接可见。

Co-Authored-By: glm-5.2 <zai-org@claude-code-best.win>
This commit is contained in:
claude-code-best
2026-06-14 11:33:16 +08:00
parent 0f1403bd87
commit 2b90445b9a

View File

@@ -150,6 +150,12 @@ export function WorkflowsPanel({
confirmYes: () => {
if (confirmKill === 'workflow' && focused) {
svc.kill(focused.runId);
// 杀掉整个 workflow 后立即回主 chatrun_done 事件 → store reducer 把 status 改为
// killed → notifications.ts 桥接 enqueuePendingNotification主 chat 展示
// `Workflow "<name>" was stopped`。继续停在面板反而让用户错过"已停止"反馈。
setConfirmKill(null);
onDone();
return;
} else if (confirmKill === 'agent' && focused) {
const agent = visibleAgents[clampedAgent];
if (agent) svc.killAgent(focused.runId, agent.id);