Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(desktop): clarify workflow wait status (#3245)

Tsai Yuanea47184c0a32
diff --git a/apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx b/apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx
index 6093e0fdd4..27e34155bc 100644
--- a/apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx
@@ -89,6 +89,7 @@ import {
} from '@/components/chat/InterruptedTurnBanner';
import { useBackgroundBashTasks } from '@/hooks/useBackgroundBashTasks';
import { useSessionBackgroundActivity } from '@/hooks/useSessionBackgroundActivity';
+import { workflowAgentVisualState } from '@/features/right-sidebar/plugins/background-tasks/workflowProgressModel';
import { VendorIcon } from '@/components/sidebar/VendorIcon';
import {
APP_EXIT_INTERRUPTED_REASON,
@@ -549,6 +550,34 @@ function findLatestWorkflowTask(
return latest;
}
+function summarizeRunningWorkflow(taskUpdates: ReadonlyMap<string, AgentTaskUpdate>): {
+ done: number;
+ total: number;
+} | null {
+ let workflow: AgentTaskUpdate | undefined;
+ let latestTs = Number.NEGATIVE_INFINITY;
+ const seen = new Set<AgentTaskUpdate>();
+ for (const update of taskUpdates.values()) {
+ if (update.taskType !== 'local_workflow' || update.status !== 'running' || seen.has(update)) continue;
+ seen.add(update);
+ const timestamp = Date.parse(update.updatedAt ?? update.createdAt ?? '');
+ if ((Number.isFinite(timestamp) ? timestamp : 0) >= latestTs) {
+ workflow = update;
+ latestTs = Number.isFinite(timestamp) ? timestamp : 0;
+ }
+ }
+ if (!workflow) return null;
+ const agents = (workflow.workflowProgress ?? []).filter((entry) => entry.type === 'workflow_agent');
+ if (agents.length === 0) return { done: 0, total: 0 };
+ return {
+ done: agents.filter((entry) => {
+ const visual = workflowAgentVisualState(entry.state);
+ return visual === 'done' || visual === 'failed';
+ }).length,
+ total: agents.length,
+ };
+}
+
export function CCAgentSessionView({
sessionIdProp,
routeOwner,
@@ -1726,6 +1755,17 @@ export function CCAgentSessionView({
!agentStatus.isRunning &&
!isStreaming &&
Boolean(sessionId);
+ // SSH 与 device-link 镜像的 task 终态都可能在断连窗口丢失,不能用本地事件永久撑住状态栏。
+ const runningWorkflow = useMemo(
+ () => (isRemoteSession || remoteDeviceId ? null : summarizeRunningWorkflow(taskUpdates)),
+ [isRemoteSession, remoteDeviceId, taskUpdates],
+ );
+ const composerStatus =
+ runningWorkflow
+ ? runningWorkflow.total > 0
+ ? t('ccAgent.agentStatus.waitingWorkflowProgress', runningWorkflow)
+ : t('ccAgent.agentStatus.waitingWorkflow')
+ : agentStatus.status;
// error-tail-banner:会话尾部停在未忽略的 role='error' 行 → 输入框上方显示
// 可操作红条(与 live ErrorBanner 同风格;2026-07-05 产品决策统一——所有尾部
@@ -4274,16 +4314,20 @@ export function CCAgentSessionView({
{(!pendingPlanReview || (hasControlledBanner && controlledBannerCollapsed)) && (
<RunningStatusBar
key={sessionId}
- status={agentStatus.status}
+ status={composerStatus}
tokenUsage={agentStatus.tokenUsage}
outputTokens={agentStatus.outputTokens ?? 0}
generationDurationMs={agentStatus.generationDurationMs ?? 0}
generationReliable={agentStatus.generationReliable ?? true}
startedAt={agentStatus.startedAt}
- visible={!pendingPlanReview && (agentStatus.isRunning || backgroundTasksActive)}
+ visible={
+ !pendingPlanReview &&
+ (agentStatus.isRunning || backgroundTasksActive || runningWorkflow !== null)
+ }
inputWidth={inputWidth}
sideTaskRunning={agentStatus.sideTaskRunning ?? false}
backgroundTasksRunning={backgroundTasksActive}
+ workflowStatus={runningWorkflow ? composerStatus : undefined}
// 仅后台 Bash 在跑(无模型调用)时换专属文案 + 温和停止语义:
// 逐任务 stopTask,不关常驻子进程。proxy 信号在时维持原语义
// (关子进程止损,bash 任务随之终止,无需再逐个停)。
@@ -5029,6 +5073,7 @@ function RunningStatusBar({
inputWidth,
sideTaskRunning = false,
backgroundTasksRunning = false,
+ workflowStatus,
backgroundBashOnlyCount = 0,
backgroundStopping = false,
onStopBackgroundTasks,
@@ -5058,6 +5103,8 @@ function RunningStatusBar({
* 计数在此语义下都是误导信息。替代原独立横幅(2026-07-13 假停止治理)。
*/
backgroundTasksRunning?: boolean;
+ /** 本机 Workflow 在运行时的专属状态文案;保留后台停止语义,但优先解释等待进度。 */
+ workflowStatus?: string;
/**
* 后台模式细分:>0 表示当前只有后台 Bash 任务在跑(无模型调用)。左段换
* 「后台任务运行中(N 个)」文案,「全部停止」tooltip 换成逐任务停止语义
@@ -5116,6 +5163,7 @@ function RunningStatusBar({
}, [startedAt]);
const isHidden = suppressContent || (!showContent && !visible);
+ const workflowWaiting = workflowStatus !== undefined;
// side-task / 后台子任务运行中永远当成进行态 (即便上一轮 LLM 留下的 status 文案
// 是 "Done", 此时任务还在跑, 显示 ✓ 完成图标会让用户以为已经做完)。
@@ -5123,11 +5171,11 @@ function RunningStatusBar({
// 后台子任务模式的左段文案:上一轮残留的 status(多半是 "Done")在此语义下是
// 误导信息,整体替换为后台运行提示。仅后台 Bash 时用带数量的专属文案 ——
// 「模型用量仍在消耗」对不调模型的 bash 任务是错误陈述。
- const displayStatus = backgroundTasksRunning
+ const displayStatus = workflowStatus ?? (backgroundTasksRunning
? backgroundBashOnlyCount > 0
? t('chat.backgroundActivity.bashStatus', { count: backgroundBashOnlyCount })
: t('chat.backgroundActivity.status')
- : localizeAgentStatus(status, t);
+ : localizeAgentStatus(status, t));
// F-COMPACT-1: when SDK is auto-summarizing the conversation, give the
// status bar a distinct icon so the user can tell "Compacting..." apart
// from "Thinking..." — both share the shimmer animation by design, but
@@ -5292,7 +5340,7 @@ function RunningStatusBar({
? t('chat.backgroundActivity.stopping')
: t('chat.backgroundActivity.stopAll')}
</button>
- ) : (
+ ) : workflowWaiting ? null : (
<>
<span className="text-13 font-medium text-[var(--status-bar-meta)]">
{elapsedText}
diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.json
index 1c2b5e4e5e..1975ecf3e7 100644
--- a/apps/desktop/src/renderer/i18n/locales/en/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json
@@ -7709,6 +7709,8 @@
"waiting": "Just wait…",
"working": "Working…",
"running": "Running…",
+ "waitingWorkflow": "Waiting for Workflow…",
+ "waitingWorkflowProgress": "Waiting for Workflow · {{done}}/{{total}} agents",
"turnStart": "{{status}}",
"issueTip": "{{name}}, try /issue to send us feedback or suggestions",
"runningTool": "{{tool}} running…"
diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.json
index 6eb2feae8d..644c80d330 100644
--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json
@@ -7697,6 +7697,8 @@
"waiting": "少々お待ちください…",
"working": "作業中…",
"running": "実行中…",
+ "waitingWorkflow": "Workflow を待機中…",
+ "waitingWorkflowProgress": "Workflow を待機中 · {{done}}/{{total}} Agent",
"turnStart": "{{name}} さん、対応中です…",
"issueTip": "{{name}} さん、/issue でフィードバックや提案をお寄せください",
"runningTool": "{{tool}} を実行中…"
diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.json
index cbddf70ac5..d7a70cb3c5 100644
--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json
@@ -7697,6 +7697,8 @@
"waiting": "잠시만 기다려 주세요…",
"working": "작업 중…",
"running": "실행 중…",
+ "waitingWorkflow": "Workflow 대기 중…",
+ "waitingWorkflowProgress": "Workflow 대기 중 · {{done}}/{{total}} Agent",
"turnStart": "{{name}}님, 처리 중이에요…",
"issueTip": "{{name}}님, /issue로 피드백이나 제안을 보내 주세요",
"runningTool": "{{tool}} 실행 중…"
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
index 6a74b71a90..23348eadcd 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
@@ -7697,6 +7697,8 @@
"waiting": "请稍候…",
"working": "正在工作…",
"running": "运行中…",
+ "waitingWorkflow": "正在等待 Workflow…",
+ "waitingWorkflowProgress": "正在等待 Workflow · {{done}}/{{total}} Agent",
"turnStart": "正在处理,{{name}}",
"issueTip": "{{name}},试试用 /issue 给我们提反馈或建议",
"runningTool": "{{tool}} 运行中…"
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
index 4a64f1a52b..558943e7fb 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
@@ -7697,6 +7697,8 @@
"waiting": "請稍候…",
"working": "正在工作…",
"running": "執行中…",
+ "waitingWorkflow": "正在等待 Workflow…",
+ "waitingWorkflowProgress": "正在等待 Workflow · {{done}}/{{total}} Agent",
"turnStart": "正在處理,{{name}}",
"issueTip": "{{name}},試試用 /issue 給我們提反饋或建議",
"runningTool": "{{tool}} 執行中…"