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(mobile): 协同 Worker 操作只保留归档,去掉设为焦点与返回 Lead (#5159)

Dashda94e838ee58
diff --git a/apps/mobile/app/sessions/[sessionId].tsx b/apps/mobile/app/sessions/[sessionId].tsx
index ca6d6354a3..734d228dfb 100644
--- a/apps/mobile/app/sessions/[sessionId].tsx
+++ b/apps/mobile/app/sessions/[sessionId].tsx
@@ -8975,8 +8975,6 @@ export default function SessionScreen() {
});
}}
worker={collab.isWorker ? {
- onOpenLead: collab.workerLeadSessionId ? collab.openLead : undefined,
- onSetFocus: collab.workerSelf && !collab.workerSelf.focused ? () => void collab.setSelfFocus() : undefined,
onArchive: collab.workerSelf ? (onConfirmed) => collab.confirmArchiveSelf(onConfirmed) : undefined,
} : undefined}
onRegenerateTitle={() => maker.regenerateSessionTitle(sessionId)}
diff --git a/apps/mobile/src/__tests__/orcaCollabScreenWiring.test.ts b/apps/mobile/src/__tests__/orcaCollabScreenWiring.test.ts
index f34ec93fd4..6304674655 100644
--- a/apps/mobile/src/__tests__/orcaCollabScreenWiring.test.ts
+++ b/apps/mobile/src/__tests__/orcaCollabScreenWiring.test.ts
@@ -51,8 +51,10 @@ describe('mobile Orca collaboration wiring', () => {
expect(menu).toContain('{!messageOnly && !workerMode && (');
expect(menu).toContain('{workerMode ? null : !messageOnly && isSharedTaskPeer');
// 归档确认在面板仍展开时弹出(iOS 原生 sheet 收起中弹 Alert 会丢),确认后再收起。
- expect(menu).toContain('run: () => worker.onArchive?.(onClose)');
- expect(menu).toContain('(row.keepOpen ? row.run() : onRun(row.run))');
+ expect(menu).toContain('const archive = () => onArchive(onClose);');
+ // Worker 详情只有归档:不再有返回 Lead / 设为焦点。
+ expect(page).not.toContain('onOpenLead:');
+ expect(page).not.toContain('onSetFocus:');
});
it('keeps Worker lifecycle on the Orca path instead of the generic task menu', () => {
diff --git a/apps/mobile/src/__tests__/useOrcaWorkerForm.test.tsx b/apps/mobile/src/__tests__/useOrcaWorkerForm.test.tsx
index 50cd3cc77e..46088c20e2 100644
--- a/apps/mobile/src/__tests__/useOrcaWorkerForm.test.tsx
+++ b/apps/mobile/src/__tests__/useOrcaWorkerForm.test.tsx
@@ -139,11 +139,11 @@ it('opens a Worker on tap and keeps the long-press action menu within three butt
act(() => collab!.openWorker(worker));
expect(openSession).toHaveBeenCalledWith('s-1');
expect(alert.mock.calls.length).toBe(alertsBefore);
- // 长按才弹管理操作,单层且不超过三个按钮。
+ // 长按才弹管理操作:手机上只有归档(焦点是电脑端协同面板的展示,不在手机上切换)。
act(() => collab!.showWorkerActions(worker));
- expect(alert.mock.calls.at(-1)![2]!.length).toBeLessThanOrEqual(3);
+ expect(alert.mock.calls.at(-1)![2]!.map((button) => button.style)).toEqual(['destructive', 'cancel']);
act(() => collab!.showWorkerActions({ ...worker, focused: true }));
- expect(alert.mock.calls.at(-1)![2]!.length).toBeLessThanOrEqual(3);
+ expect(alert.mock.calls.at(-1)![2]!.map((button) => button.style)).toEqual(['destructive', 'cancel']);
});
it('moves an untouched form off an Agent the computer does not have', async () => {
@@ -333,11 +333,10 @@ it('restores the remembered Agent after a device switch instead of the previous
expect(latest!.form.agent).toBe('claude-code');
});
-it('lets a Worker task focus itself and archive itself back to the Lead', async () => {
+it('lets a Worker task archive itself back to the Lead', async () => {
const { Alert } = await import('react-native');
const { useSessionOrcaCollab } = await import('@/session/useSessionOrcaCollab');
let collab: ReturnType<typeof useSessionOrcaCollab> | null = null;
- const switchFocus = vi.fn(async () => ({}));
const archiveWorker = vi.fn(async () => ({}));
const maker = {
...fakeMaker(),
@@ -345,7 +344,6 @@ it('lets a Worker task focus itself and archive itself back to the Lead', async
listWorkers: vi.fn(async () => [{ id: 'w-1', sessionId: 'worker-1', role: 'tester', focused: false }]),
getCollaborationSettings: vi.fn(async () => ({})),
getTeamByWorkerSession: vi.fn(async () => ({ leadSessionId: 'lead-1' })),
- switchFocus,
archiveWorker,
},
} as unknown as MobileMakerTransport;
@@ -362,8 +360,6 @@ it('lets a Worker task focus itself and archive itself back to the Lead', async
await act(async () => { await flush(); });
expect(collab!.workerLeadSessionId).toBe('lead-1');
expect(collab!.workerSelf?.workerId).toBe('w-1');
- await act(async () => { await collab!.setSelfFocus(); });
- expect(switchFocus).toHaveBeenCalledWith('lead-1', 'w-1');
// 确认弹窗先弹出(详情面板还开着),确认后才收起面板再归档。
const closeMenu = vi.fn();
act(() => collab!.confirmArchiveSelf(closeMenu));
diff --git a/apps/mobile/src/i18n/locales/en/session.json b/apps/mobile/src/i18n/locales/en/session.json
index 3bb35369b7..e69cd2ff89 100644
--- a/apps/mobile/src/i18n/locales/en/session.json
+++ b/apps/mobile/src/i18n/locales/en/session.json
@@ -583,8 +583,6 @@
"archiveConfirm": "Archive Worker",
"archiveConfirmTitle": "Archive Worker {{name}}?",
"archiveConfirmDesc": "This stops its session. History is kept as archived. Archived Workers can't be restored; create a new Worker to continue.",
- "setFocus": "Set as focus",
- "backToLead": "Back to Lead",
"loadingHint": "Checking collaboration settings…",
"disabledHint": "Collaboration mode is off. Turn it back on in Settings on your computer.",
"unavailableHint": "Couldn't check collaboration settings. Try again later.",
@@ -608,7 +606,6 @@
"startFailed": "Couldn't start collaboration.",
"createFailed": "Couldn't create the Worker.",
"archiveFailed": "Couldn't archive the Worker.",
- "switchFailed": "Couldn't switch focus.",
"stopFailed": "Couldn't end collaboration.",
"WORKER_LIMIT_HARD_EXCEEDED": "The Worker hard limit is reached. Archive a Worker first.",
"NO_PROVIDER_FOR_AGENT": "The computer has no model provider connected for this Agent. Connect one on the computer and try again.",
diff --git a/apps/mobile/src/i18n/locales/ja/session.json b/apps/mobile/src/i18n/locales/ja/session.json
index 1e1420a1cb..413364ce73 100644
--- a/apps/mobile/src/i18n/locales/ja/session.json
+++ b/apps/mobile/src/i18n/locales/ja/session.json
@@ -583,8 +583,6 @@
"archiveConfirm": "Worker をアーカイブ",
"archiveConfirmTitle": "Worker {{name}} をアーカイブしますか?",
"archiveConfirmDesc": "セッションを停止します。履歴はアーカイブとして残ります。アーカイブした Worker は復元できないため、続けるには新しい Worker を作成してください。",
- "setFocus": "フォーカスにする",
- "backToLead": "Lead に戻る",
"loadingHint": "コラボレーション設定を確認中…",
"disabledHint": "コラボレーションモードがオフです。コンピューターの設定で有効にしてください",
"unavailableHint": "コラボレーション設定を確認できませんでした。しばらくしてから再試行してください",
@@ -608,7 +606,6 @@
"startFailed": "コラボレーションを開始できませんでした。",
"createFailed": "Worker を作成できませんでした。",
"archiveFailed": "Worker をアーカイブできませんでした。",
- "switchFailed": "フォーカスを切り替えられませんでした。",
"stopFailed": "コラボレーションを終了できませんでした。",
"WORKER_LIMIT_HARD_EXCEEDED": "Worker の上限に達しました。先に Worker をアーカイブしてください。",
"NO_PROVIDER_FOR_AGENT": "コンピューターにこの Agent 用のモデルプロバイダーが接続されていません。コンピューターで接続してから再試行してください。",
diff --git a/apps/mobile/src/i18n/locales/ko/session.json b/apps/mobile/src/i18n/locales/ko/session.json
index 1d1ddb45ca..e391361136 100644
--- a/apps/mobile/src/i18n/locales/ko/session.json
+++ b/apps/mobile/src/i18n/locales/ko/session.json
@@ -579,8 +579,6 @@
"archiveConfirm": "Worker 보관",
"archiveConfirmTitle": "Worker {{name}}을(를) 보관할까요?",
"archiveConfirmDesc": "세션을 중지합니다. 기록은 보관 상태로 남습니다. 보관한 Worker는 복원할 수 없으니 계속하려면 새 Worker를 만드세요.",
- "setFocus": "포커스로 지정",
- "backToLead": "Lead로 돌아가기",
"loadingHint": "협업 설정 확인 중…",
"disabledHint": "협업 모드가 꺼져 있습니다. 컴퓨터 설정에서 다시 켜세요",
"unavailableHint": "협업 설정을 확인하지 못했습니다. 잠시 후 다시 시도하세요",
@@ -604,7 +602,6 @@
"startFailed": "협업을 시작하지 못했습니다.",
"createFailed": "Worker를 만들지 못했습니다.",
"archiveFailed": "Worker를 보관하지 못했습니다.",
- "switchFailed": "포커스를 바꾸지 못했습니다.",
"stopFailed": "협업을 종료하지 못했습니다.",
"WORKER_LIMIT_HARD_EXCEEDED": "Worker 최대 수에 도달했습니다. 먼저 Worker를 보관하세요.",
"NO_PROVIDER_FOR_AGENT": "컴퓨터에 이 Agent용 모델 제공자가 연결되어 있지 않습니다. 컴퓨터에서 연결한 뒤 다시 시도하세요.",
diff --git a/apps/mobile/src/i18n/locales/zh-CN/session.json b/apps/mobile/src/i18n/locales/zh-CN/session.json
index f235aba1d6..5678dd69ec 100644
--- a/apps/mobile/src/i18n/locales/zh-CN/session.json
+++ b/apps/mobile/src/i18n/locales/zh-CN/session.json
@@ -579,8 +579,6 @@
"archiveConfirm": "归档 Worker",
"archiveConfirmTitle": "归档 Worker {{name}}?",
"archiveConfirmDesc": "这会停止这个 Worker 的运行;历史记录会以归档状态保留。归档后无法恢复,需要重新创建 Worker 派任务。",
- "setFocus": "设为焦点",
- "backToLead": "返回 Lead",
"loadingHint": "正在确认协同设置…",
"disabledHint": "协同模式已关闭,请在电脑端设置中重新启用",
"unavailableHint": "暂时无法确认协同设置,请稍后重试",
@@ -604,7 +602,6 @@
"startFailed": "开启协同失败。",
"createFailed": "创建 Worker 失败。",
"archiveFailed": "归档 Worker 失败。",
- "switchFailed": "切换焦点失败。",
"stopFailed": "结束协同失败。",
"WORKER_LIMIT_HARD_EXCEEDED": "已达 Worker 硬上限,请先归档现有 Worker。",
"NO_PROVIDER_FOR_AGENT": "电脑端没有为该 Agent 连接可用的模型供应商。请在电脑端完成连接后重试。",
diff --git a/apps/mobile/src/i18n/locales/zh-TW/session.json b/apps/mobile/src/i18n/locales/zh-TW/session.json
index 03312f5bd3..1ac64deb67 100644
--- a/apps/mobile/src/i18n/locales/zh-TW/session.json
+++ b/apps/mobile/src/i18n/locales/zh-TW/session.json
@@ -583,8 +583,6 @@
"archiveConfirm": "封存 Worker",
"archiveConfirmTitle": "封存 Worker {{name}}?",
"archiveConfirmDesc": "這會停止這個 Worker 的執行;歷史記錄會以封存狀態保留。封存後無法復原,需要重新建立 Worker 派任務。",
- "setFocus": "設為焦點",
- "backToLead": "返回 Lead",
"loadingHint": "正在確認協同設定…",
"disabledHint": "協同模式已關閉,請在電腦端設定中重新啟用",
"unavailableHint": "暫時無法確認協同設定,請稍後重試",
@@ -608,7 +606,6 @@
"startFailed": "開啟協同失敗。",
"createFailed": "建立 Worker 失敗。",
"archiveFailed": "封存 Worker 失敗。",
- "switchFailed": "切換焦點失敗。",
"stopFailed": "結束協同失敗。",
"WORKER_LIMIT_HARD_EXCEEDED": "已達 Worker 硬上限,請先封存現有 Worker。",
"NO_PROVIDER_FOR_AGENT": "電腦端沒有為該 Agent 連接可用的模型供應商。請在電腦端完成連接後重試。",
diff --git a/apps/mobile/src/session/SessionMenuSheet.tsx b/apps/mobile/src/session/SessionMenuSheet.tsx
index 3237759335..1b1b6bb158 100644
--- a/apps/mobile/src/session/SessionMenuSheet.tsx
+++ b/apps/mobile/src/session/SessionMenuSheet.tsx
@@ -22,8 +22,6 @@ import {
Archive,
ArchiveRestore,
Copy,
- CornerUpLeft,
- Crosshair,
Link2,
LogOut,
Pencil,
@@ -104,10 +102,6 @@ export interface SessionExtraDirBrowserState {
}
export interface SessionMenuWorkerActions {
- /** 查不到所属 Lead 时为 undefined(入口不出现)。 */
- onOpenLead?: () => void;
- /** 已是焦点 / 查不到自身记录时为 undefined。 */
- onSetFocus?: () => void;
/**
* 查不到自身记录时为 undefined。确认弹窗在详情面板仍展开时弹出(iOS 原生 sheet 正在收起时
* 弹 Alert 会丢),确认后由 onConfirmed 收起面板。
@@ -614,14 +608,7 @@ export function SessionMenuSheet({
{!messageOnly ? <SessionUsageSummary providerName={providerName} session={session} usage={menuUsage} contextUsage={contextUsage} onPress={openInfo} translucent={Platform.OS === 'ios'} /> : null}
{workerMode ? (
- <WorkerMenuActions
- onClose={onClose}
- worker={worker}
- onRun={(action) => {
- onClose();
- action();
- }}
- />
+ <WorkerMenuActions onClose={onClose} worker={worker} />
) : null}
{workerMode ? null : !messageOnly && isSharedTaskPeer(session.deviceLinkDeviceId) && onLeaveSharing ? (
@@ -1037,48 +1024,44 @@ function menuActionIcon(action: SessionMenuAction, session: Pick<RemoteSession,
}
}
-/** 协同 Worker 任务的详情操作:返回 Lead / 设为焦点 / 归档 Worker(各自可用时才出现)。 */
+/**
+ * 协同 Worker 任务的详情操作:只有归档 Worker。返回 Lead 走左上角返回与输入框上方的协同条;
+ * 「焦点」只影响电脑端协同面板展开哪个 Worker,手机上不提供。
+ */
function WorkerMenuActions({
worker,
- onRun,
onClose,
}: {
worker: SessionMenuWorkerActions | undefined;
- onRun(action: () => void): void;
onClose(): void;
}) {
const { t } = useTranslation();
const styles = useThemedStyles(makeStyles);
- const rows = [
- worker?.onOpenLead ? { key: 'lead', icon: CornerUpLeft, label: t('session.collab.backToLead'), danger: false, run: worker.onOpenLead, testID: 'session.workerBackToLead', keepOpen: false } : null,
- worker?.onSetFocus ? { key: 'focus', icon: Crosshair, label: t('session.collab.setFocus'), danger: false, run: worker.onSetFocus, testID: 'session.workerSetFocus', keepOpen: false } : null,
- worker?.onArchive ? { key: 'archive', icon: Archive, label: t('session.collab.archiveConfirm'), danger: true, run: () => worker.onArchive?.(onClose), testID: 'session.workerArchive', keepOpen: true } : null,
- ].filter((row): row is NonNullable<typeof row> => row !== null);
- if (rows.length === 0) return null;
+ const onArchive = worker?.onArchive;
+ if (!onArchive) return null;
+ // 确认弹窗在面板仍展开时弹出,确认后由 onClose 收起(见 SessionMenuWorkerActions.onArchive)。
+ const archive = () => onArchive(onClose);
if (Platform.OS === 'ios') {
return (
<SessionDetailsNativeActions
- actions={rows.map((row) => ({
- label: row.label,
- danger: row.danger,
- onPress: () => (row.keepOpen ? row.run() : onRun(row.run)),
- testID: row.testID,
- }))}
+ actions={[{
+ label: t('session.collab.archiveConfirm'),
+ danger: true,
+ onPress: archive,
+ testID: 'session.workerArchive',
+ }]}
/>
);
}
return (
<View style={styles.actionGroup} testID="session.workerActions">
- {rows.map((row) => (
- <MenuActionRow
- danger={row.danger}
- icon={row.icon}
- key={row.key}
- label={row.label}
- onPress={() => (row.keepOpen ? row.run() : onRun(row.run))}
- testID={row.testID}
- />
- ))}
+ <MenuActionRow
+ danger
+ icon={Archive}
+ label={t('session.collab.archiveConfirm')}
+ onPress={archive}
+ testID="session.workerArchive"
+ />
</View>
);
}
diff --git a/apps/mobile/src/session/useSessionOrcaCollab.ts b/apps/mobile/src/session/useSessionOrcaCollab.ts
index f4bbe9f2ce..6c8f5fd9d7 100644
--- a/apps/mobile/src/session/useSessionOrcaCollab.ts
+++ b/apps/mobile/src/session/useSessionOrcaCollab.ts
@@ -639,32 +639,19 @@ export function useSessionOrcaCollab(params: {
}, [runTeamAction, sessionId]);
/**
- * 长按 Worker 行:管理操作(点按直接打开 Worker,不弹窗)。Android 原生 Alert 最多三个
- * 按钮:已是焦点时「归档 / 取消」,否则「设为焦点 / 归档 / 取消」。
+ * 长按 Worker 行:管理操作(点按直接打开 Worker,不弹窗)。手机上只提供归档;「焦点」只决定
+ * 电脑端协同面板展开哪个 Worker,手机上不提供切换。
*/
const showWorkerActions = useCallback((worker: OrcaTeamWorker) => {
- const name = orcaWorkerDisplayName(worker);
- const cancel = { text: i18n.t('session.collab.cancel'), style: 'cancel' as const };
- const archive = {
- text: i18n.t('session.collab.archive'),
- style: 'destructive' as const,
- onPress: () => confirmArchive(worker),
- };
- if (worker.focused) {
- Alert.alert(name, orcaWorkerStatusLabel(worker.status), [archive, cancel]);
- return;
- }
- const setFocus = {
- text: i18n.t('session.collab.setFocus'),
- onPress: () => {
- void runTeamAction(
- () => makerRef.current.orca.switchFocus(sessionId, worker.workerId),
- 'session.collab.errors.switchFailed',
- );
+ Alert.alert(orcaWorkerDisplayName(worker), orcaWorkerStatusLabel(worker.status), [
+ {
+ text: i18n.t('session.collab.archive'),
+ style: 'destructive',
+ onPress: () => confirmArchive(worker),
},
- };
- Alert.alert(name, orcaWorkerStatusLabel(worker.status), [setFocus, archive, cancel]);
- }, [confirmArchive, runTeamAction, sessionId]);
+ { text: i18n.t('session.collab.cancel'), style: 'cancel' },
+ ]);
+ }, [confirmArchive]);
const confirmEndTeam = useCallback(() => {
Alert.alert(
@@ -698,19 +685,6 @@ export function useSessionOrcaCollab(params: {
// ─── Worker 任务自身的操作(详情菜单) ─────────────────────────────────────
const refreshWorkerTeam = workerTeam.refresh;
- const setSelfFocus = useCallback(async () => {
- if (!workerLeadSessionId || !workerSelf) return;
- try {
- await makerRef.current.orca.switchFocus(workerLeadSessionId, workerSelf.workerId);
- } catch (err) {
- Alert.alert(describeOrcaError(
- isOrcaAmbiguousTimeout(err) ? new Error('[ORCA_ACTION_UNCONFIRMED] timed out') : err,
- 'session.collab.errors.switchFailed',
- ));
- } finally {
- void refreshWorkerTeam();
- }
- }, [refreshWorkerTeam, workerLeadSessionId, workerSelf]);
/** 归档自身:确认弹窗在调用方的面板上直接弹出;用户确认后先调 onConfirmed(如收起详情面板)再归档。 */
const confirmArchiveSelf = useCallback((onConfirmed?: () => void) => {
@@ -768,7 +742,6 @@ export function useSessionOrcaCollab(params: {
/** Worker 任务自身在团队里的记录;查不到(老被控端 / 读取中)为 null,Worker 操作不出现。 */
workerSelf,
refreshWorkerSelf: refreshWorkerTeam,
- setSelfFocus,
confirmArchiveSelf,
workerForm,
busy,
diff --git a/docs/dev-rules/orca-team-architecture.md b/docs/dev-rules/orca-team-architecture.md
index 4ea056d3fd..c9b4b7f70e 100644
--- a/docs/dev-rules/orca-team-architecture.md
+++ b/docs/dev-rules/orca-team-architecture.md
@@ -51,7 +51,7 @@ Orca 是 Cindy Desktop 内的多 agent 协同能力:一个 **Lead session**
- workflow_run / CC Workflow 编排还未纳入当前实现。
- side_chat 尚未登记为 side activity 对象,也未挂进 pane;PR #107 只是 fork 数据动作。
- device-link 协同的 Lead / Worker / team 全部在被控端进程内编排,控制端只按 session 来源经隧道路由(`makerTransport` 的 `makerApiFor` / `orcaWorkflowsFor` / `subscribeOrcaWorkerChanged`,channel 见 `packages/device-link/src/allowlist.ts` 的 Orca 段)。collab 开关同样查被控端(`maker:plugins:get-state` 经 `pluginEnableStateFor`):项目读取被控端项目级策略,对话读取被控端用户级/全局级策略。控制端本机状态不能代表被控端真相。老被控端没有该 channel 时回 `CHANNEL_NOT_ALLOWED`,控制端 fail-closed 置灰入口并提示设备版本过旧,而不是放行到 `enableOrca` 才撞错。
-- 手机端是同一套 device-link 控制端:Lead / Worker 任务与普通任务一样可操作(发消息、处理确认、编辑队列、Fork / Rewind、任务设置),协同编排经 `apps/mobile/src/device-link/mobileMakerTransport.ts` 的 `orca` 组走与桌面控制端相同的 channel(开启 / 创建 / 切换焦点 / 确认完成 / 归档 / 结束、Worker 列表、协同设置只读)。入口判定、超时回查与错误文案在 `apps/mobile/src/session/orcaTeam.ts`,会话页与新建任务页的状态在 `useSessionOrcaCollab.ts`。新建任务开启协同不走二段派单:createSession 后、首条消息入队前即时 `enable-orca`,Worker 任务按 `buildDraftWorkerInitialTask` 附带待发送的 Lead 输入作为上下文;失败时任务照单任务继续并在会话页提示。协同设置(Worker 上限、空闲释放)在手机上只读。「创建 Worker」的记忆规则与桌面 `workerCreationPrefs` 一致(上次的 Agent、每个 Agent 的模型 / 推理强度 / Fast、Worker 权限;初始任务不记;首次默认值共用 `@cindy/maker-shared/orca-team`),与桌面控制端一样存在发起创建的一端(`apps/mobile/src/session/orcaWorkerPrefs.ts`,按账号隔离),不读写被控端偏好;记住的模型不在该电脑可用列表时回落被控端默认。
+- 手机端是同一套 device-link 控制端:Lead / Worker 任务与普通任务一样可操作(发消息、处理确认、编辑队列、Fork / Rewind、任务设置),协同编排经 `apps/mobile/src/device-link/mobileMakerTransport.ts` 的 `orca` 组走与桌面控制端相同的 channel(开启 / 创建 / 确认完成 / 归档 / 结束、Worker 列表、协同设置只读);「焦点」只决定电脑端协同面板展开哪个 Worker,手机上只展示、不提供切换。入口判定、超时回查与错误文案在 `apps/mobile/src/session/orcaTeam.ts`,会话页与新建任务页的状态在 `useSessionOrcaCollab.ts`。新建任务开启协同不走二段派单:createSession 后、首条消息入队前即时 `enable-orca`,Worker 任务按 `buildDraftWorkerInitialTask` 附带待发送的 Lead 输入作为上下文;失败时任务照单任务继续并在会话页提示。协同设置(Worker 上限、空闲释放)在手机上只读。「创建 Worker」的记忆规则与桌面 `workerCreationPrefs` 一致(上次的 Agent、每个 Agent 的模型 / 推理强度 / Fast、Worker 权限;初始任务不记;首次默认值共用 `@cindy/maker-shared/orca-team`),与桌面控制端一样存在发起创建的一端(`apps/mobile/src/session/orcaWorkerPrefs.ts`,按账号隔离),不读写被控端偏好;记住的模型不在该电脑可用列表时回落被控端默认。
- SSH 远端协同支持 Claude Code、Codex 与 Pi Lead / Worker;Worker 继承 Lead 的 `remoteHostId` 与远端工作目录,在同一台远端主机执行,启动前复用远端就绪检查。cc 远端经 `cc-remote-mcp.ts` 把 `cindy_orca` / `orca_worker_bridge` 以 http 形态追加进 `startParams.mcpServers`(persistent token + `?session=` 路由,白名单仅此两个 server)。远端 worker 手动 `send_to_lead` 依赖 daemon 侧 `orca_worker_bridge` 经同一 bridge 可达;auto-bridge 回报不依赖 worker 侧 MCP,天然可用。Claude Code / Codex 共享 userData 多实例连同一远端 host 时,只有先建立 SSH 转发的实例能持有该 host 的 MCP bridge 端口,其余实例按“远端无 MCP”降级(与历史行为一致)。远端会话的项目级 collab 开关不查本机 fs;`assertCollabProjectEnabled` 对 remote 只查用户级/全局级开关,远端项目级配置机制是 follow-up。
Pi 的远端 Lead 沿用统一的 Lead 身份与 prompt 装配;内部 MCP(含 `cindy_orca`、