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。

feat(desktop): mark remote agents with a signal on the Agent icon

Liziba810d579e1b
diff --git a/apps/desktop/src/renderer/__tests__/remoteAgentVendorIcon.test.tsx b/apps/desktop/src/renderer/__tests__/remoteAgentVendorIcon.test.tsx
new file mode 100644
index 0000000000..de55456f63
--- /dev/null
+++ b/apps/desktop/src/renderer/__tests__/remoteAgentVendorIcon.test.tsx
@@ -0,0 +1,135 @@
+// @vitest-environment jsdom
+/**
+ * Agent 在另一台电脑运行(任务在本机)的标识:Agent 图标右上角加模型选择器同款的单波纹 + 点,
+ * 替代标题后的芯片图标(2026-10-07 用户裁决)。
+ *
+ * 锁四件事:波纹不改 Agent 图标本身的大小;只有本机任务 + agentDeviceId 才画;右上角正显示
+ * 状态点时由状态点占位;悬停说明在哪台电脑、是否离线。
+ */
+import React from 'react';
+import { cleanup, render } from '@testing-library/react';
+import { afterEach, describe, expect, it, vi } from 'vitest';
+
+import type { Session } from '@/lib/ccAgent.types';
+
+const devices = vi.hoisted(() => ({
+ list: [{ deviceId: 'device-b', name: 'Studio Mac', online: true }] as Array<{
+ deviceId: string;
+ name: string;
+ online: boolean;
+ }>,
+}));
+
+vi.mock('react-i18next', () => ({
+ initReactI18next: { type: '3rdParty', init: vi.fn() },
+ useTranslation: () => ({
+ t: (key: string, opts?: { device?: string }) => (opts?.device ? `${key}:${opts.device}` : key),
+ }),
+}));
+vi.mock('@/hooks/useComposerDraftPresence', () => ({ useComposerDraftPresence: () => false }));
+vi.mock('@/hooks/useSessionPausedQueue', () => ({ useSessionPausedQueue: () => false }));
+vi.mock('@/features/device-link/useDeviceLinkDeviceList', () => ({
+ useDeviceLinkDeviceList: () => devices.list,
+}));
+
+import { VendorIcon } from '@/components/sidebar/VendorIcon';
+import { SessionStatusIcon } from '@/features/cc-agent/sidebar/SessionStatusIcon';
+
+const SIGNAL_ARC = 'M12 1.4A2.6 2.6 0 0 1 14.6 4';
+
+function signal(container: HTMLElement): Element | null {
+ return container.querySelector(`path[d="${SIGNAL_ARC}"]`);
+}
+
+function attentionDot(container: HTMLElement): Element | undefined {
+ return Array.from(container.querySelectorAll('span')).find((node) =>
+ (node.getAttribute('class') ?? '').includes('bg-[var(--card-status-'),
+ );
+}
+
+function renderStatus(
+ session: Partial<Session>,
+ props: { hasAttentionNotification?: boolean; showAttentionDot?: boolean } = {},
+) {
+ return render(
+ <SessionStatusIcon
+ session={{ id: 's1', agentKind: 'cc', status: 'active', ...session } as Session}
+ isRunning={false}
+ isAttached={false}
+ hasAttentionNotification={props.hasAttentionNotification ?? false}
+ isActive={false}
+ showAttentionDot={props.showAttentionDot}
+ />,
+ );
+}
+
+afterEach(() => {
+ cleanup();
+ devices.list = [{ deviceId: 'device-b', name: 'Studio Mac', online: true }];
+});
+
+describe('VendorIcon remote signal', () => {
+ it('adds the signal outside the glyph without resizing the Agent glyph', () => {
+ const local = render(<VendorIcon vendor="cc" size={13} />);
+ expect(signal(local.container)).toBeNull();
+ cleanup();
+
+ const { container } = render(<VendorIcon vendor="cc" size={13} remote />);
+ const svgs = container.querySelectorAll('svg');
+ expect(svgs).toHaveLength(2);
+ expect(svgs[0].getAttribute('width')).toBe('13');
+ expect(signal(container)).not.toBeNull();
+ // 波纹绝对定位、跟随图标取色(currentColor),不占布局。
+ expect(svgs[1].getAttribute('class')).toContain('absolute');
+ expect(svgs[1].getAttribute('stroke')).toBe('currentColor');
+ });
+
+ it('runs the signal through the same running color and breathing as the glyph', () => {
+ const { container } = render(<VendorIcon vendor="codex" size={12} remote running />);
+ const wrapper = container.firstElementChild as HTMLElement;
+ expect(wrapper.className).toContain('text-[var(--warning-accent)]');
+ expect(wrapper.className).toContain('session-status-breathing');
+ expect(wrapper.contains(signal(container))).toBe(true);
+ });
+});
+
+describe('SessionStatusIcon for an Agent on another computer', () => {
+ it('marks the Agent icon and names the computer on hover', () => {
+ const { container, getByTitle } = renderStatus({ agentDeviceId: 'device-b' });
+ expect(signal(container)).not.toBeNull();
+ expect(getByTitle('ccAgent.sessionHeader.agentDevice:Studio Mac')).toBeTruthy();
+ });
+
+ it('says when that computer is offline', () => {
+ devices.list = [{ deviceId: 'device-b', name: 'Studio Mac', online: false }];
+ const { getByTitle } = renderStatus({ agentDeviceId: 'device-b' });
+ expect(getByTitle('ccAgent.sessionHeader.agentDeviceOffline:Studio Mac')).toBeTruthy();
+ });
+
+ it('leaves local, device-link and SSH tasks unmarked', () => {
+ expect(signal(renderStatus({}).container)).toBeNull();
+ cleanup();
+ expect(
+ signal(renderStatus({ agentDeviceId: 'device-b', deviceLinkDeviceId: 'device-c' }).container),
+ ).toBeNull();
+ cleanup();
+ expect(
+ signal(renderStatus({ agentDeviceId: 'device-b', remoteHostId: 'host-1' }).container),
+ ).toBeNull();
+ });
+
+ it('gives the top-right corner to the attention dot while one is shown', () => {
+ const withDot = renderStatus({ agentDeviceId: 'device-b' }, { hasAttentionNotification: true });
+ expect(attentionDot(withDot.container)).toBeDefined();
+ expect(signal(withDot.container)).toBeNull();
+ cleanup();
+
+ // 侧栏行不在左侧画状态点(右侧状态槽承担),波纹照常显示。
+ const row = renderStatus(
+ { agentDeviceId: 'device-b' },
+ { hasAttentionNotification: true, showAttentionDot: false },
+ );
+ expect(attentionDot(row.container)).toBeUndefined();
+ expect(signal(row.container)).not.toBeNull();
+ });
+});
diff --git a/apps/desktop/src/renderer/__tests__/sidebarRemoteProjectIcon.test.ts b/apps/desktop/src/renderer/__tests__/sidebarRemoteProjectIcon.test.ts
index 4b064bf177..aa91c2f286 100644
--- a/apps/desktop/src/renderer/__tests__/sidebarRemoteProjectIcon.test.ts
+++ b/apps/desktop/src/renderer/__tests__/sidebarRemoteProjectIcon.test.ts
@@ -31,8 +31,13 @@ describe('sidebar remote project icon', () => {
expect(remoteProjectIconSource).toMatch(
/kind === 'device-link'\s+\?\s+MonitorSmartphone\s+:\s+Globe/,
);
- // Agent 在另一台电脑运行的本机任务有自己的标识,不冒充远程设备任务。
- expect(remoteProjectIconSource).toMatch(/kind === 'agent-device'\s+\?\s+Cpu/);
+ // Agent 在另一台电脑运行的本机任务不冒充远程设备任务:标识画在左侧 Agent 图标上
+ // (信号波纹,见 remoteAgentVendorIcon.test.tsx),标题后不再另放芯片图标(2026-10-07)。
+ expect(remoteProjectIconSource).not.toContain('agent-device');
+ expect(remoteProjectIconSource).not.toContain('Cpu');
+ expect(sessionItemSource).not.toContain('kind="agent-device"');
+ expect(sessionCardSource).not.toContain('kind="agent-device"');
+ expect(sessionHeaderSource).not.toContain('kind="agent-device"');
expect(sessionItemSource).toMatch(
/const remoteIconKind = session\.deviceLinkDeviceId\s+\?\s+'device-link'\s+:\s+session\.remoteHostId\s+\?\s+'ssh'\s+:\s+null/,
);
diff --git a/apps/desktop/src/renderer/components/icons/RemoteSourceMark.tsx b/apps/desktop/src/renderer/components/icons/RemoteSourceMark.tsx
index dc118b5835..d03d4fd5f9 100644
--- a/apps/desktop/src/renderer/components/icons/RemoteSourceMark.tsx
+++ b/apps/desktop/src/renderer/components/icons/RemoteSourceMark.tsx
@@ -6,13 +6,47 @@
*
* 几何(16 单位画布):品牌占左下 12.5 × 12.5,波纹从品牌右上角向外发出,
* 点落在连接角内。颜色全部跟随 currentColor,Light / Dark 由外层文字色决定。
+ *
+ * 侧栏等处的 Agent 图标(Agent 在另一台电脑运行)用同一道波纹,但图形不缩放、
+ * 不移位,见 RemoteSignalOverlay。
*/
-import type { ReactNode } from 'react';
+import type { CSSProperties, ReactNode } from 'react';
import { cn } from '@/lib/utils';
/** 品牌图形在 16 单位画布里所占边长(左下对齐)。 */
const BRAND_UNITS = 12.5;
+/** 品牌区右上角在 16 单位画布里的纵坐标。 */
+const BRAND_TOP_UNITS = 16 - BRAND_UNITS;
+
+/** 波纹 + 点本体(16 单位画布)。远程供应商 Logo 与远程 Agent 图标共用这一笔。 */
+function RemoteSignal({
+ size,
+ className,
+ style,
+}: {
+ size: number;
+ className?: string;
+ style?: CSSProperties;
+}) {
+ return (
+ <svg
+ viewBox="0 0 16 16"
+ width={size}
+ height={size}
+ className={className}
+ style={style}
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={1.4}
+ strokeLinecap="round"
+ aria-hidden
+ >
+ <path d="M12 1.4A2.6 2.6 0 0 1 14.6 4" />
+ <circle cx="12.6" cy="3.4" r="0.95" fill="currentColor" stroke="none" />
+ </svg>
+ );
+}
export function RemoteSourceMark({
size,
@@ -47,19 +81,38 @@ export function RemoteSourceMark({
>
{children}
</span>
- <svg
- viewBox="0 0 16 16"
- width={size}
- height={size}
- className="absolute inset-0"
- fill="none"
- stroke="currentColor"
- strokeWidth={1.4}
- strokeLinecap="round"
- >
- <path d="M12 1.4A2.6 2.6 0 0 1 14.6 4" />
- <circle cx="12.6" cy="3.4" r="0.95" fill="currentColor" stroke="none" />
- </svg>
+ <RemoteSignal size={size} className="absolute inset-0" />
</span>
);
}
+
+/**
+ * 给原位、原大小的图形叠同一道波纹:图形本身不缩放不移位(同列图标照旧对齐),
+ * 波纹画到图形右上角外侧。把图形当作品牌区,几何与 RemoteSourceMark 一致。
+ *
+ * anchorX / anchorY 是图形笔画右上角在自身方框里的位置(0–1):像素脸、花形这类
+ * 不顶满方框的图形按实际笔画给,波纹才贴着图形而不是悬在方框角上。
+ * 父级需要 `relative`,且不能裁剪溢出。
+ */
+export function RemoteSignalOverlay({
+ markSize,
+ anchorX = 1,
+ anchorY = 0,
+}: {
+ /** 被叠加图形的边长,px。 */
+ markSize: number;
+ anchorX?: number;
+ anchorY?: number;
+}) {
+ const unit = markSize / BRAND_UNITS;
+ return (
+ <RemoteSignal
+ size={unit * 16}
+ className="pointer-events-none absolute"
+ style={{
+ left: (anchorX - 1) * markSize,
+ top: anchorY * markSize - BRAND_TOP_UNITS * unit,
+ }}
+ />
+ );
+}
diff --git a/apps/desktop/src/renderer/components/sidebar/VendorIcon.tsx b/apps/desktop/src/renderer/components/sidebar/VendorIcon.tsx
index 2660bd7b47..ce93051622 100644
--- a/apps/desktop/src/renderer/components/sidebar/VendorIcon.tsx
+++ b/apps/desktop/src/renderer/components/sidebar/VendorIcon.tsx
@@ -11,14 +11,29 @@
* - idle (默认) : Stone 灰 #737373 / dark #a3a3a3
* - running=true : Thinking Orange(--warning-accent,全主题同值)+ session-breathing 呼吸;选中态同样橙(用户拍板 2026-07-20)
*
+ * Agent 在另一台电脑运行(remote):右上角加模型选择器同款的单波纹 + 点,波纹随图标
+ * 取色与呼吸;glyph 大小与位置不变(2026-10-07 用户裁决,替代标题后的芯片图标)。
+ *
*/
import { cn } from '@/lib/utils';
import { ClaudeMark } from '@/components/icons/ClaudeMark';
import { CodexMark } from '@/components/icons/CodexMark';
+import { RemoteSignalOverlay } from '@/components/icons/RemoteSourceMark';
export type VendorIconKind = 'cc' | 'codex' | 'pi';
+/**
+ * 各 glyph 笔画右上角在自身方框里的位置(0–1,已留出与波纹点的间隙)。
+ * 像素脸头部占 viewBox x 0–21 / y 5–20;花形放大 1.1 后右上沿在 (19.1, 4.9);
+ * π 字形偏小且居中。
+ */
+const REMOTE_SIGNAL_ANCHOR: Record<VendorIconKind, { x: number; y: number }> = {
+ cc: { x: 0.95, y: 0.13 },
+ codex: { x: 0.9, y: 0.1 },
+ pi: { x: 0.83, y: 0.36 },
+};
+
/**
* agentKind → VendorIcon vendor 的唯一映射。所有渲染 agent 身份图标的调用点
* 必须走这里,禁止各自写 `=== 'codex' ? 'codex' : 'cc'` 二元三元(那会把 pi
@@ -37,6 +52,10 @@ interface VendorIconProps {
/** 覆盖默认取色(如选中态传 active 前景 —— 用户规则 2026-07-20:选中态上
* 所有前景元素与文字同色);running 呼吸动画不受影响。 */
colorClassName?: string;
+ /** true → Agent 在另一台电脑运行:右上角外侧叠信号波纹(不占布局,向右上溢出)。 */
+ remote?: boolean;
+ /** 悬停说明(如 Agent 在哪台电脑上运行)。 */
+ title?: string;
}
export function VendorIcon({
@@ -45,9 +64,13 @@ export function VendorIcon({
running = false,
className,
colorClassName,
+ remote = false,
+ title,
}: VendorIconProps) {
+ const anchor = REMOTE_SIGNAL_ANCHOR[vendor];
const wrapperClassName = cn(
'inline-flex shrink-0',
+ remote && 'relative',
running && 'session-status-breathing',
// running 呼吸一律 Thinking Orange(--warning-accent,07-17 定稿 running 状态色);
// 用户拍板 2026-07-20:选中态也保持橙,优先级高于 colorClassName 反相前景。
@@ -56,7 +79,7 @@ export function VendorIcon({
);
return (
- <span className={wrapperClassName}>
+ <span className={wrapperClassName} title={title}>
{vendor === 'codex' ? (
<CodexMark size={size} />
) : vendor === 'pi' ? (
@@ -70,6 +93,7 @@ export function VendorIcon({
) : (
<ClaudeMark size={size} />
)}
+ {remote && <RemoteSignalOverlay markSize={size} anchorX={anchor.x} anchorY={anchor.y} />}
</span>
);
}
diff --git a/apps/desktop/src/renderer/features/cc-agent/NewMakerDraftRoute.tsx b/apps/desktop/src/renderer/features/cc-agent/NewMakerDraftRoute.tsx
index 3fd34b0462..c9271be9b1 100644
--- a/apps/desktop/src/renderer/features/cc-agent/NewMakerDraftRoute.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/NewMakerDraftRoute.tsx
@@ -173,7 +173,8 @@ import {
} from './deferredUiAssignment';
import { CrossAgentConvertDialog } from '@/components/ui/cross-agent-convert-dialog';
import type { MakerVendor } from '@/lib/ccAgent.types';
-import { ChevronDown, Cpu, MessageSquare, MonitorSmartphone } from 'lucide-react';
+import { ChevronDown, MessageSquare, MonitorSmartphone } from 'lucide-react';
+import { VendorIcon } from '@/components/sidebar/VendorIcon';
import { HomeSuggestionList } from './HomeSuggestionList';
import { type HomeSuggestionId, homeSuggestionPromptKey } from './homeSuggestions';
import {
@@ -5775,7 +5776,13 @@ export function NewMakerDraftRoute() {
标识同位置、同样式,两者互斥。 */}
{isAgentDeviceDraft && (
<div className="mt-3 flex max-w-full items-center gap-2 self-center rounded-full border border-[var(--border-default)] bg-[var(--surface-chip)] px-3 py-1 text-12 text-[var(--text-secondary)]">
- <Cpu size={14} strokeWidth={2} className="shrink-0 text-[var(--folder-item-icon)]" />
+ {/* 与侧栏同一标识:Agent 图标 + 右上信号波纹。 */}
+ <VendorIcon
+ vendor={persistedAgentKind}
+ size={persistedAgentKind === 'cc' ? 14 : 13}
+ remote
+ colorClassName="text-[var(--folder-item-icon)]"
+ />
<span className="min-w-0 truncate">
{t('ccAgent.draft.agentDeviceBanner', {
device: draft.agentDeviceName ?? effectiveAgentDeviceId ?? '',
diff --git a/apps/desktop/src/renderer/features/cc-agent/SessionContentHeader.tsx b/apps/desktop/src/renderer/features/cc-agent/SessionContentHeader.tsx
index 81ffbf2ded..3bd533675a 100644
--- a/apps/desktop/src/renderer/features/cc-agent/SessionContentHeader.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/SessionContentHeader.tsx
@@ -68,6 +68,7 @@ import { SessionRenameInput } from './SessionRenameInput';
import { useSessionBoundSchedules } from '@/features/scheduler/lib/scheduleSessionBinding';
import { ScheduleBindingBadge } from './sidebar/ScheduleBindingBadge';
import { RemoteProjectIcon } from './sidebar/RemoteProjectIcon';
+import { VendorIcon, agentKindToVendor } from '@/components/sidebar/VendorIcon';
import { MENU_ITEM_CLASS, MENU_ROW_CLASS } from './sidebar/menuStyles';
import { SessionProjectMoveSubmenu } from './sidebar/SessionProjectMoveSubmenu';
import type { SessionMoveTarget } from './sidebar/sessionMoveTarget';
@@ -83,13 +84,21 @@ const log = createLogger('SessionContentHeader');
/**
* 任务在本机、Agent 在同账号另一台电脑上运行:标明那台电脑,离线时如实提示(不自动改在本机跑)。
+ * 图标与侧栏同款:Agent 图标 + 右上信号波纹。
*/
-function AgentDeviceIndicator({ deviceId }: { deviceId: string }) {
+function AgentDeviceIndicator({
+ deviceId,
+ agentKind,
+}: {
+ deviceId: string;
+ agentKind: Session['agentKind'];
+}) {
const { t } = useTranslation();
const devices = useDeviceLinkDeviceList();
const device = devices?.find((item) => item.deviceId === deviceId);
const name = device?.name || deviceId;
const offline = device ? !device.online : false;
+ const vendor = agentKindToVendor(agentKind);
return (
<Tip
text={t(
@@ -103,10 +112,13 @@ function AgentDeviceIndicator({ deviceId }: { deviceId: string }) {
className="inline-flex"
style={WINDOW_NO_DRAG_STYLE}
>
- <RemoteProjectIcon
- kind="agent-device"
- connectionStatus={offline ? 'disconnected' : 'connected'}
- className="mr-1 text-[var(--cmd-palette-item-meta)]"
+ {/* 波纹向右上溢出约 3px,右边距比其它标题前缀图标多留一些。 */}
+ <VendorIcon
+ vendor={vendor}
+ size={vendor === 'cc' ? 14 : 13}
+ remote
+ colorClassName="text-[var(--cmd-palette-item-meta)]"
+ className={cn('mr-2', offline && 'opacity-75')}
/>
</span>
</Tip>
@@ -587,7 +599,7 @@ export function SessionContentHeader({
</Tip>
)}
{!isEditing && !remoteIconKind && session.agentDeviceId && (
- <AgentDeviceIndicator deviceId={session.agentDeviceId} />
+ <AgentDeviceIndicator deviceId={session.agentDeviceId} agentKind={session.agentKind} />
)}
{isEditing ? (
diff --git a/apps/desktop/src/renderer/features/cc-agent/sidebar/RemoteProjectIcon.tsx b/apps/desktop/src/renderer/features/cc-agent/sidebar/RemoteProjectIcon.tsx
index 2462bc954d..6e2f471b11 100644
--- a/apps/desktop/src/renderer/features/cc-agent/sidebar/RemoteProjectIcon.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/sidebar/RemoteProjectIcon.tsx
@@ -1,10 +1,13 @@
-import { Cpu, Globe, MonitorOff, MonitorSmartphone } from 'lucide-react';
+import { Globe, MonitorOff, MonitorSmartphone } from 'lucide-react';
import { cn } from '@/lib/utils';
import type { DeviceLinkConnectionStatus } from '@/lib/ccAgent.types';
-/** agent-device:任务在本机、Agent 在同账号另一台电脑上运行。 */
-type RemoteProjectIconKind = 'device-link' | 'ssh' | 'agent-device';
+/**
+ * 整件任务在远端(device-link 设备 / SSH 主机)。任务在本机、只有 Agent 在另一台电脑
+ * 运行的不走这里:标识画在 Agent 图标上(VendorIcon remote 的信号波纹)。
+ */
+type RemoteProjectIconKind = 'device-link' | 'ssh';
interface RemoteProjectIconProps {
kind: RemoteProjectIconKind;
@@ -23,14 +26,7 @@ export function RemoteProjectIcon({
className,
}: RemoteProjectIconProps) {
const disconnected = kind !== 'ssh' && connectionStatus === 'disconnected';
- const Icon =
- kind === 'agent-device'
- ? Cpu
- : disconnected
- ? MonitorOff
- : kind === 'device-link'
- ? MonitorSmartphone
- : Globe;
+ const Icon = disconnected ? MonitorOff : kind === 'device-link' ? MonitorSmartphone : Globe;
return (
<Icon
size={size}
diff --git a/apps/desktop/src/renderer/features/cc-agent/sidebar/SessionCard.tsx b/apps/desktop/src/renderer/features/cc-agent/sidebar/SessionCard.tsx
index 63129ccb96..1990b4f076 100644
--- a/apps/desktop/src/renderer/features/cc-agent/sidebar/SessionCard.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/sidebar/SessionCard.tsx
@@ -815,19 +815,7 @@ export const SessionCard = withSidebarNavigation<SessionCardProps>(function Sess
}
/>
)}
- {/* 任务在本机、Agent 在另一台电脑运行。 */}
- {!remoteIconKind && session.agentDeviceId && (
- <RemoteProjectIcon
- kind="agent-device"
- size={12}
- strokeWidth={1.8}
- className={
- isActive
- ? 'text-sidebar-item-active-foreground'
- : 'text-sidebar-action-icon'
- }
- />
- )}
+ {/* Agent 在另一台电脑运行(任务在本机)的标识在 Agent 图标上(信号波纹)。 */}
{sourceLabel ? (
<span
title={sourceLabel}
@@ -1101,16 +1089,6 @@ export const SessionCard = withSidebarNavigation<SessionCardProps>(function Sess
}
/>
)}
- {!remoteIconKind && session.agentDeviceId && (
- <RemoteProjectIcon
- kind="agent-device"
- size={11}
- strokeWidth={1.8}
- className={
- isActive ? 'text-sidebar-item-active-foreground' : 'text-[var(--text-tertiary)]'
- }
- />
- )}
{/* 任务信息复选:卡片版右下角与 list/text 同源;默认仅 time 与旧渲染等价。 */}
<SessionInfoMeta
pieces={cardInfoPieces}
diff --git a/apps/desktop/src/renderer/features/cc-agent/sidebar/SessionItem.tsx b/apps/desktop/src/renderer/features/cc-agent/sidebar/SessionItem.tsx
index fcdf102f8e..559483dfa5 100644
--- a/apps/desktop/src/renderer/features/cc-agent/sidebar/SessionItem.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/sidebar/SessionItem.tsx
@@ -1083,17 +1083,7 @@ export const SessionItem = withSidebarNavigation<SessionItemProps>(function Sess
)}
/>
)}
- {/* 任务在本机、Agent 在另一台电脑运行。 */}
- {!remoteIconKind && session.agentDeviceId && (
- <RemoteProjectIcon
- kind="agent-device"
- size={12}
- strokeWidth={1.8}
- className={cn(
- isActive ? 'text-sidebar-item-active-foreground' : 'text-sidebar-action-icon',
- )}
- />
- )}
+ {/* Agent 在另一台电脑运行(任务在本机)的标识在左侧 Agent 图标上(信号波纹)。 */}
{sourceLabel ? (
<span
title={sourceLabel}
diff --git a/apps/desktop/src/renderer/features/cc-agent/sidebar/SessionStatusIcon.tsx b/apps/desktop/src/renderer/features/cc-agent/sidebar/SessionStatusIcon.tsx
index 409accf356..cafb0ee02c 100644
--- a/apps/desktop/src/renderer/features/cc-agent/sidebar/SessionStatusIcon.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/sidebar/SessionStatusIcon.tsx
@@ -10,6 +10,8 @@
* running:图标切 Thinking Orange + 呼吸;需关注:右上叠状态点(全端统一色表:
* error 红 / awaiting TapTap 蓝 / 完成未读绿,tone 按行精准订阅 attention store);
* 有未发送内容(草稿/暂停队列)且未选中:右下叠铅笔。
+ * Agent 在另一台电脑运行(任务在本机):VendorIcon 右上角加信号波纹,悬停说明哪台电脑;
+ * 右上角正显示状态点时由状态点占位,波纹暂不画(两者同角,叠在一起读不出)。
* idle 时图标照常显示——让用户一眼看出"这是哪一个 agent"。
*
*/
@@ -26,9 +28,46 @@ import { useGhostSessionBusy } from '@/cindy-brain/ghostSessionActivityStore';
import { useSessionAttentionKind } from '@/lib/sessionAttentionStore';
import { useSessionAttentionUrgency } from '../contexts/SessionAttentionUrgencyContext';
import { AttentionDot } from '@/components/sidebar/AttentionDot';
-import { VendorIcon, agentKindToVendor } from '@/components/sidebar/VendorIcon';
+import {
+ VendorIcon,
+ agentKindToVendor,
+ type VendorIconKind,
+} from '@/components/sidebar/VendorIcon';
+import { useDeviceLinkDeviceList } from '@/features/device-link/useDeviceLinkDeviceList';
import { useCindyMakeActivity } from './useCindyMakeActivity';
+/**
+ * Agent 在另一台电脑运行的 Agent 图标:带信号波纹,悬停说明在哪台电脑、是否离线。
+ * 单独成组件,只有这类任务的行才订阅设备列表(共享单例,push 驱动)。
+ */
+function AgentDeviceVendorIcon({
+ deviceId,
+ showSignal,
+ ...iconProps
+}: {
+ deviceId: string;
+ showSignal: boolean;
+ vendor: VendorIconKind;
+ size: number;
+ running: boolean;
+ colorClassName?: string;
+}) {
+ const { t } = useTranslation();
+ const device = useDeviceLinkDeviceList()?.find((item) => item.deviceId === deviceId);
+ const name = device?.name || deviceId;
+ const offline = device ? !device.online : false;
+ return (
+ <VendorIcon
+ {...iconProps}
+ remote={showSignal}
+ title={t(
+ offline ? 'ccAgent.sessionHeader.agentDeviceOffline' : 'ccAgent.sessionHeader.agentDevice',
+ { device: name },
+ )}
+ />
+ );
+}
+
export interface SessionStatusIconProps {
session: Session;
isRunning: boolean;
@@ -76,6 +115,11 @@ export function SessionStatusIcon({
const cindyMakeActivity = useCindyMakeActivity(session);
const isRunning = isAgentRunning || isGhostBusy || cindyMakeActivity != null;
const vendor = agentKindToVendor(session.agentKind);
+ // 任务在本机、Agent 在另一台电脑。device-link / SSH 任务整件在远端,标题旁另有远程图标。
+ const agentDeviceId =
+ session.agentDeviceId && !session.deviceLinkDeviceId && !session.remoteHostId
+ ? session.agentDeviceId
+ : null;
const isOrcaLead = isOrcaLeadSession(session);
const isArchived = session.status === 'archived';
// 角标 tone:error(含定时任务失败的 urgency context)红 > awaiting 蓝 > 完成未读绿。
@@ -142,6 +186,15 @@ export function SessionStatusIcon({
>
<RadioTower size={size ?? 12} strokeWidth={1.75} className="shrink-0" />
</span>
+ ) : agentDeviceId ? (
+ <AgentDeviceVendorIcon
+ deviceId={agentDeviceId}
+ showSignal={!(showAttentionDot && hasAttentionNotification)}
+ vendor={vendor}
+ size={size ?? (vendor === 'cc' ? 13 : 12)}
+ running={isRunning}
+ colorClassName={isActive ? 'text-[var(--sidebar-item-active-foreground)]' : undefined}
+ />
) : (
<VendorIcon
vendor={vendor}