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(chat): optional automatic handoff between 分工 steps

Chriscbe49a8c782d
diff --git a/apps/desktop/scripts/fixtures/group-control/group-control-fixture.tsx b/apps/desktop/scripts/fixtures/group-control/group-control-fixture.tsx
index ce92841491..c31a0191e1 100644
--- a/apps/desktop/scripts/fixtures/group-control/group-control-fixture.tsx
+++ b/apps/desktop/scripts/fixtures/group-control/group-control-fixture.tsx
@@ -20,6 +20,8 @@ interface GroupData {
arrangement?: Queue;
/** A preserved work plan whose ordinary messages must stay quiet. */
workMentioned?: boolean;
+ /** A 分工 you started (bot-group-chat.md §7.4): stopped after step 1 waiting for 继续, or going on by itself. */
+ division?: Division;
/** Open the group settings drawer as its owner. */
settings?: boolean;
/** Server read state: unread thread entries and the in-chat 话题 hint. */
@@ -172,6 +174,30 @@ function arrangementPlan(state: Queue) {
})),
};
}
+type Division = 'waiting' | 'auto';
+const DIVISION_ASK = '把发版说明整理好:先列出这周合进去的改动,再写成给用户看的说明';
+/** Your request, the organizer's card and Aster's finished first step. */
+function divisionMessages() {
+ return [
+ message({ id: 'q1', sequence: 1, isSelf: true, content: DIVISION_ASK, createdAt: T0 }),
+ message({ id: 'p2-card', sequence: 2, kind: 'plan', planId: 'p2', isSelf: true, content: '', createdAt: T0 }),
+ message({ id: 'a1', sequence: 3, authorKind: 'bot', authorBotId: 'a', authorName: 'Aster', planId: 'p2', createdAt: T0 + 4 * MINUTE,
+ content: '这周合进去 6 个改动:群聊分工入口回来了、仅 @ 模式不再误叫醒伙伴、负责人显示修好,另有 3 个小修复。' }),
+ ];
+}
+function divisionPlan(state: Division) {
+ const auto = state === 'auto';
+ return {
+ id: 'p2', status: auto ? 'running' : 'waiting', organizerBotId: 'a', organizerName: 'Aster', currentStep: auto ? 1 : 0,
+ kind: 'work', canManage: true, canAdd: true, autoContinue: auto, workDir: null, branch: null,
+ createdAt: T0, updatedAt: auto ? Date.now() - 40_000 : T0 + 4 * MINUTE,
+ steps: [
+ { position: 0, botId: 'a', botName: 'Aster', task: '列出这周合进去的改动', status: 'done', resultMessageId: 'a1' },
+ { position: 1, botId: 'b', botName: 'Nova', task: '写成给用户看的发版说明', status: auto ? 'running' : 'pending', resultMessageId: null },
+ ],
+ };
+}
+
/**
* Two Threads name the reader, one they follow is unread without naming them, one is read
* (bot-group-chat.md §10「话题未读与提示」).
@@ -216,14 +242,18 @@ function groupFrom(data: GroupData) {
openPlan: null,
createdAt: 1,
updatedAt: 1,
- plans: data.arrangement ? [{ ...arrangementPlan(data.arrangement), kind: planKind }] : [],
+ plans: data.arrangement ? [{ ...arrangementPlan(data.arrangement), kind: planKind }] : data.division ? [divisionPlan(data.division)] : [],
+ ...(data.division ? { openPlan: { id: 'p2', status: data.division === 'auto' ? 'running' : 'waiting', currentStep: data.division === 'auto' ? 1 : 0,
+ stepCount: 2, currentBotName: data.division === 'auto' ? 'Nova' : 'Aster', currentStepStatus: data.division === 'auto' ? 'running' : 'done', kind: 'work' },
+ singleSpeaker: true, autoContinue: data.division === 'auto' } : {}),
...(data.arrangement ? { openPlan: data.arrangement === 'long'
? { id: 'p1', status: 'waiting', currentStep: 4, stepCount: 7, currentBotName: 'Pax', currentStepStatus: 'done', kind: planKind }
: data.arrangement === 'running' ? { id: 'p1', status: 'running', currentStep: 1, stepCount: 2, currentBotName: 'Nova', currentStepStatus: 'running', kind: planKind } : null,
singleSpeaker: true } : {}),
- ...(data.bubbles || data.arrangement ? { serverBacked: true } : {}),
+ ...(data.bubbles || data.arrangement || data.division ? { serverBacked: true } : {}),
+ ...(data.settings ? { autoContinue: false } : {}),
...(data.threadUnread ? { threads: threadSummaries() } : {}),
- messages: data.bodyAnswer ? bodyMessages() : data.arrangement ? arrangementMessages(data.arrangement)
+ messages: data.bodyAnswer ? bodyMessages() : data.arrangement ? arrangementMessages(data.arrangement) : data.division ? divisionMessages()
: bubbles ? bubbles.map(m => (data.threadUnread && UNREAD[m.id as string] ? { ...m, threadUnread: UNREAD[m.id as string] } : m))
: Array.from({ length: data.messages }, (_, i) => ({
id: `m${i}`,
diff --git a/apps/desktop/scripts/fixtures/group-control/ui-page.mjs b/apps/desktop/scripts/fixtures/group-control/ui-page.mjs
index 6f8d58fd4f..390a27056d 100644
--- a/apps/desktop/scripts/fixtures/group-control/ui-page.mjs
+++ b/apps/desktop/scripts/fixtures/group-control/ui-page.mjs
@@ -59,8 +59,18 @@ export default {
about: 'Seven teammates: the first five answered by themselves, the card folds to three turns around Quill, who waits for 继续',
data: { ...base, members: QUEUE_CROWD, arrangement: 'long' },
},
+ 'division-waiting': {
+ about: 'A 分工 you started stopped after step 1: the card footer switch is off and 下一步 · 继续 waits',
+ viewport: { width: 1000, height: 760 },
+ data: { ...base, division: 'waiting' },
+ },
+ 'division-auto': {
+ about: 'The same 分工 with 做完一步自动交给下一位 on: Nova started step 2 by itself, no 继续 row',
+ viewport: { width: 1000, height: 760 },
+ data: { ...base, division: 'auto' },
+ },
settings: {
- about: 'Single-speaker group settings: reply mode, organizer and project folder as before; no speaking mode',
+ about: 'Single-speaker group settings: reply mode, organizer, project folder and 分工交接 (off) as before; no speaking mode',
data: { ...base, arrangement: 'running', settings: true },
},
division: {
@@ -127,10 +137,19 @@ export default {
assert.equal(await replyMode.innerText(), await ui.t('bots.groupChat.settings.replyModeMentioned'));
// Reply mode and the 分工 settings stay; one teammate at a time leaves no speaking mode (bot-group-chat.md §4.0).
assert.equal(await drawer.getByText(await ui.t('bots.groupChat.settings.speakingMode'), { exact: true }).count(), 0, 'speakingMode');
- for (const key of ['bots.groupChat.organizer', 'bots.groupChat.settings.projectDir'])
+ for (const key of ['bots.groupChat.organizer', 'bots.groupChat.settings.projectDir', 'bots.groupChat.settings.handoff'])
assert.ok(await drawer.getByText(await ui.t(key), { exact: true }).count() > 0, key);
return;
}
+ if (ui.case === 'division-waiting' || ui.case === 'division-auto') {
+ // You started this 分工: its card footer switches 做完一步自动交给下一位 (bot-group-chat.md §7.4).
+ const auto = ui.case === 'division-auto';
+ const toggle = page.getByTestId('bot-group-plan-auto');
+ await toggle.waitFor();
+ assert.equal(await toggle.getAttribute('aria-checked'), String(auto));
+ assert.equal(await page.getByTestId('bot-group-plan-follow-up').count(), auto ? 0 : 1, '下一步 · 继续');
+ return;
+ }
if (ui.case === 'division') {
await page.getByRole('button', { name: '更多操作' }).click();
await page.getByRole('menuitem', { name: /安排分工/ }).click();
diff --git a/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts
index 676ebfc068..9925f1adea 100644
--- a/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts
+++ b/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts
@@ -14,7 +14,13 @@ vi.mock('../botGroupTaskPostSnapshot.js', () => ({ prepareBotGroupTaskPost: asyn
if (!taskPosts.has(key)) taskPosts.set(key, JSON.parse(JSON.stringify(await prepare())));
return JSON.parse(JSON.stringify(taskPosts.get(key)));
} }));
-vi.mock('../chatServerWorkspaces.js', () => ({ chatServerWorkspaces: () => ({ read: () => null, save: vi.fn() }) }));
+// This computer's group settings; each test starts with none.
+const workspaceSettings = vi.hoisted(() => new Map<string, unknown>());
+vi.mock('../chatServerWorkspaces.js', () => ({ chatServerWorkspaces: () => ({
+ read: (room: string) => workspaceSettings.get(room) ?? null,
+ save: (room: string, value: unknown) => { workspaceSettings.set(room, value); },
+}) }));
+beforeEach(() => workspaceSettings.clear());
const migration = vi.hoisted(() => ({ read: vi.fn<(_groupId: string) => { roomId: string; sequence: number; version: 2 } | null>(() => null) }));
vi.mock('../chatMigrationReceipts.js', () => ({ chatMigrationReceipts: () => ({ read: migration.read, save: vi.fn() }) }));
vi.mock('electron', () => ({ app: { get isPackaged() { return fixture.packaged; }, getPath: () => '/isolated' },
@@ -162,6 +168,69 @@ describe('Chat Server result delivery and refresh', () => {
service = withChatServer({ listGroups: vi.fn(async () => ({ ok: true, groups: [] })), settleLaneTurn: vi.fn(async () => false), dispose: vi.fn() } as unknown as BotGroupChatService, deps);
});
afterEach(() => { service.dispose(); vi.useRealTimers(); vi.unstubAllEnvs(); fixture.config = ''; vi.clearAllMocks(); });
+ describe('分工 auto-continue on this computer (bot-group-chat.md §7.4)', () => {
+ const planId = '80000000-0000-4000-8000-000000000009';
+ const otherHuman = '30000000-0000-4000-8000-000000000002';
+ const division = (over: Record<string, unknown> = {}, first = 'done') => ({ id: planId, revision: 3, kind: 'work',
+ source_message_id: execution.source_message_id, request_text: 'build it', organizer_id: botId, creator_id: selfId,
+ status: 'waiting', current_step: 0, created_at: '2026-10-03T00:00:00Z', updated_at: '2026-10-03T00:00:00Z',
+ steps: [{ position: 0, botId, botName: 'Bot', task: 'draft', status: first }, { position: 1, botId, botName: 'Bot', task: 'polish', status: 'pending' }],
+ ...over });
+ const continues = () => fixture.handle.mock.calls.filter(([route, method, body]) =>
+ route === `/conversations/${roomId}/plans/${planId}` && method === 'POST' && (body as { action?: string })?.action === 'continue');
+ const stepEnded = async (cursor: string) => {
+ fixture.sockets[0]!.emit('message', JSON.stringify({ type: 'changes', scope: `conversation:${roomId}`, cursor,
+ changes: [{ type: 'execution.updated', entityId: execution.id }] }));
+ await vi.advanceTimersByTimeAsync(0);
+ };
+ async function serve(plan: Record<string, unknown>, settings: { autoContinue?: boolean } | null, onContinue?: () => { status: number; body: unknown }) {
+ if (settings) workspaceSettings.set(roomId, { projectDir: null, plans: {}, ...settings });
+ fixture.handle.mockImplementation((route, method) => route === `/conversations/${roomId}/plans/${planId}` && method === 'POST'
+ ? onContinue?.() ?? { body: {} } : route.startsWith(`/conversations/${roomId}/plans`) ? { body: [plan] } : response(route));
+ await service.getGroup(roomId);
+ await vi.advanceTimersByTimeAsync(2000);
+ }
+ it('goes on to the next step of a 分工 started here once a step is done', async () => {
+ await serve(division(), { autoContinue: true });
+ await stepEnded('2');
+ expect(continues()).toHaveLength(1);
+ expect(continues()[0]![2]).toMatchObject({ expectedRevision: 3 });
+ // The same finished step is not continued twice when later changes arrive.
+ await stepEnded('3');
+ expect(continues()).toHaveLength(1);
+ });
+ it.each([
+ ['the switch is off', division(), { autoContinue: false }],
+ ['nothing was chosen on this computer', division(), null],
+ ['the step failed and waits for 重试', division({}, 'failed'), { autoContinue: true }],
+ ['someone else started the 分工', division({ creator_id: otherHuman }), { autoContinue: true }],
+ ['it is a discussion queue, not a 分工', division({ kind: 'talk' }), { autoContinue: true }],
+ ['the 分工 was stopped', division({ status: 'stopped' }), { autoContinue: true }],
+ ['the last step is done', division({ current_step: 1, status: 'waiting', steps: [
+ { position: 0, botId, botName: 'Bot', task: 'draft', status: 'done' }, { position: 1, botId, botName: 'Bot', task: 'polish', status: 'done' }] }), { autoContinue: true }],
+ ])('keeps waiting for 继续 when %s', async (_case, plan, settings) => {
+ await serve(plan, settings);
+ await stepEnded('2');
+ expect(continues()).toHaveLength(0);
+ });
+ it('turning it on while a step waits goes on now, and shows the choice on the group and its 分工 card', async () => {
+ await serve(division(), null);
+ const before = await service.getGroup(roomId);
+ expect(before.ok && [before.group.autoContinue, before.group.plans[0]?.autoContinue]).toEqual([false, false]);
+ expect(await service.updateGroup({ groupId: roomId, autoContinue: true })).toEqual({ ok: true });
+ await vi.advanceTimersByTimeAsync(0);
+ expect(workspaceSettings.get(roomId)).toMatchObject({ autoContinue: true, projectDir: null });
+ expect(continues()).toHaveLength(1);
+ const after = await service.getGroup(roomId);
+ expect(after.ok && [after.group.autoContinue, after.group.plans[0]?.autoContinue]).toEqual([true, true]);
+ });
+ it('does not try again after someone else went on first', async () => {
+ await serve(division(), { autoContinue: true }, () => ({ status: 409, body: { error: { code: 'REVISION_CONFLICT' } } }));
+ await stepEnded('2');
+ await stepEnded('3');
+ expect(continues()).toHaveLength(1);
+ });
+ });
it('uses the mobile edited revision instead of a newer server snapshot when saving settings', async () => {
await service.updateGroup({ groupId: roomId, name: 'Draft', expectedRevision: 7 });
expect(fixture.handle).toHaveBeenCalledWith(`/conversations/${roomId}`, 'PATCH', expect.objectContaining({ name: 'Draft', expectedRevision: 7 }));
diff --git a/apps/desktop/src/main/maker-ipc/chatServer.ts b/apps/desktop/src/main/maker-ipc/chatServer.ts
index 23649a9c11..4f72a92871 100644
--- a/apps/desktop/src/main/maker-ipc/chatServer.ts
+++ b/apps/desktop/src/main/maker-ipc/chatServer.ts
@@ -886,7 +886,7 @@ function createChatServer(local: BotGroupChatService, deps: BotGroupChatServiceD
for (const roomId of rooms.keys()) invalidate(roomId);
ws.send(JSON.stringify({ type: 'subscribe', scope: `actor:${selfId}`, after: '0' }));
for (const [roomId, cursor] of rooms) ws.send(JSON.stringify({ type: 'subscribe', scope: `conversation:${roomId}`, after: cursor }));
- void syncPersonalList(true).then(() => { if (current() && socket === ws) { for (const roomId of rooms.keys()) changed(roomId); changed(''); } }).catch(() => ws.close());
+ void syncPersonalList(true).then(() => { if (current() && socket === ws) { for (const roomId of rooms.keys()) { changed(roomId); autoContinuePlans(roomId); } changed(''); } }).catch(() => ws.close());
} else if (event.type === 'changes') {
// This adapter stores no client history. Each invalidation re-reads authoritative
// state; a reconnect resumes after the last cursor this process has read or acked.
@@ -903,8 +903,11 @@ function createChatServer(local: BotGroupChatService, deps: BotGroupChatServiceD
const types = changes.map(change => (change as { type?: unknown } | null)?.type);
// Lease renewals append no change; ordinary chatter cannot revoke a lease, so it does
// not renew one either. Any other or unknown change re-checks the room's running work.
- if (!types.length || types.some(type => typeof type !== 'string' || !CHATTER_CHANGES.has(type)))
+ if (!types.length || types.some(type => typeof type !== 'string' || !CHATTER_CHANGES.has(type))) {
for (const run of running.values()) if (run.execution.conversation_id === roomId) void checkLease(run);
+ // A step ends with an execution change, wherever its companion ran.
+ autoContinuePlans(roomId);
+ }
if (changes.some(queuedForThisDevice)) {
for (const change of changes) {
const value = change as { entityId?: unknown; data?: { botId?: unknown } };
@@ -1326,7 +1329,7 @@ function createChatServer(local: BotGroupChatService, deps: BotGroupChatServiceD
...(m.ownerActorId === selfId && m.kind === 'bot' ? { homeDeviceId: actors.find(a => a.id === m.id)?.homeDeviceId ?? null } : {}),
avatarUrl: m.avatar?.startsWith('https://') ? m.avatar : null,
name: memberName(m), avatar: m.groupAvatar ? '' : p?.avatar ?? (m.avatar?.startsWith('https://') ? '' : m.avatar) ?? '', avatarColor: p?.avatarColor ?? 'violet', status: p?.status ?? 'active' };
- }), organizerBotId: ((id?: string) => id ? localBot(id)?.id ?? id : null)(s.room.organizer_id ?? s.members.find(m => m.kind === 'bot' && m.state === 'joined')?.id), projectDir: workspace?.projectDir ?? null, lastMessage: last && lastView ? {
+ }), organizerBotId: ((id?: string) => id ? localBot(id)?.id ?? id : null)(s.room.organizer_id ?? s.members.find(m => m.kind === 'bot' && m.state === 'joined')?.id), projectDir: workspace?.projectDir ?? null, autoContinue: workspace?.autoContinue === true, lastMessage: last && lastView ? {
isSelf: lastView.isSelf, authorKind: lastView.authorKind, authorName: lastView.authorName, noticeCode: lastView.noticeCode,
preview: lastIsShare ? '' : (botGroupMessageSummaryText(lastView) || mediaNames(last)).slice(0, 80), createdAt: lastView.createdAt, ...(lastIsShare ? { threadShare: true } : {}),
} : null, speakingBotIds: speakers.map(s => s.botId), planningBotId: planning.get(roomId)?.botId ?? null, openPlan: open ? { id: open.id, status: open.status, currentStep: open.currentStep, stepCount: open.steps.length, currentBotName: open.steps[open.currentStep ?? 0]?.botName ?? null, currentStepStatus: open.steps[open.currentStep ?? 0]?.status ?? null, ...(open.kind ? { kind: open.kind } : {}) } : null,
@@ -1349,6 +1352,8 @@ function createChatServer(local: BotGroupChatService, deps: BotGroupChatServiceD
canManage: plan.creator_id === selfId || members.some(m => m.ownerActorId === selfId && m.state === 'joined' && ['owner', 'admin'].includes(m.role)),
// Same rule as sendMessage's commentPlan: additions are written as the human, so a teammate's role does not count.
canAdd: plan.creator_id === selfId || members.some(m => m.id === selfId && ['owner', 'admin'].includes(m.role)) } : {}),
+ // Only a 分工 started here follows this computer's choice; its 继续 is pressed from here.
+ ...(plan.kind === 'work' && plan.creator_id === selfId ? { autoContinue: workspace?.autoContinue === true } : {}),
createdAt: Date.parse(plan.created_at), updatedAt: Date.parse(plan.updated_at) };
}
async function actPlan(input: unknown, action: string) {
@@ -1369,6 +1374,43 @@ function createChatServer(local: BotGroupChatService, deps: BotGroupChatServiceD
action: serverAction, position: i.position, botId }, asManager);
changed(room); return { ok: true as const };
}
+ /**
+ * 分工 started here with this computer's 自动交接 on: once a step is done, start the next one as
+ * 继续 would. A failed step, a stopped 分工 and the last step still wait (bot-group-chat.md §7.4).
+ * The expected revision keeps a concurrent 继续 or edit from starting a step twice.
+ */
+ const autoContinueRuns = new Map<string, boolean>();
+ const autoContinued = new Set<string>();
+ function autoContinuePlans(roomId: string) {
+ if (!current()) return;
+ if (autoContinueRuns.has(roomId)) { autoContinueRuns.set(roomId, true); return; }
+ autoContinueRuns.set(roomId, false);
+ void (async () => {
+ do {
+ autoContinueRuns.set(roomId, false);
+ if (!workspaces().read(roomId)?.autoContinue) return;
+ const plans = await api<ServerPlan[]>(`/conversations/${roomId}/plans`);
+ for (const plan of plans) {
+ const at = plan.current_step ?? 0;
+ if (plan.kind !== 'work' || plan.creator_id !== selfId || plan.status !== 'waiting'
+ || plan.steps[at]?.status !== 'done' || at + 1 >= plan.steps.length) continue;
+ const key = `${plan.id}:${at}`;
+ if (autoContinued.has(key)) continue;
+ autoContinued.add(key);
+ if (autoContinued.size > 1000) autoContinued.delete(autoContinued.values().next().value!);
+ try {
+ await api(`/conversations/${roomId}/plans/${plan.id}`, 'POST', { operationId: randomUUID(), expectedRevision: plan.revision, action: 'continue' });
+ changed(roomId);
+ } catch (error) {
+ // Someone else went on or changed the 分工 first; anything else may be tried again.
+ if (!(error instanceof ChatResponseError) || retryableResponse(error)) autoContinued.delete(key);
+ throw error;
+ }
+ }
+ } while (current() && autoContinueRuns.get(roomId));
+ })().catch(error => deps.log?.warn('Group 分工 auto-continue failed', { groupId: roomId, ...chatErrorDiagnostic(error) }))
+ .finally(() => autoContinueRuns.delete(roomId));
+ }
async function decideArrangement(s: Snapshot, sourceId: string, text: string, forced: boolean, attachments: BotGroupAttachment[], intent: PlanIntent, quote: BotGroupQuoteView | null = null) {
if (!current() || planIntents.get(s.room.id) !== intent) return;
const members = s.members.filter(m => m.kind === 'bot' && m.state === 'joined' && (!localBot(m.id) || localBot(m.id)?.status === 'active') && (m.ownerActorId === selfId || m.guestAccess !== 'none'));
@@ -2608,7 +2650,7 @@ function createChatServer(local: BotGroupChatService, deps: BotGroupChatServiceD
},
updateGroup: input => safe(async () => {
const i = z.object({ groupId: id, name: z.string().min(1).max(40).optional(), replyMode: z.enum(['all', 'mentioned']).optional(),
- speakingMode: z.enum(['auto', 'sequential']).optional(), organizerBotId: z.string().nullable().optional(), projectDir: z.string().max(4096).nullable().optional(), expectedRevision: z.number().int().positive().optional() }).parse(input);
+ speakingMode: z.enum(['auto', 'sequential']).optional(), organizerBotId: z.string().nullable().optional(), projectDir: z.string().max(4096).nullable().optional(), autoContinue: z.boolean().optional(), expectedRevision: z.number().int().positive().optional() }).parse(input);
i.groupId = await resolveGroup(i.groupId);
if (i.organizerBotId) await register();
const s = await groupSnapshot(i.groupId);
@@ -2618,7 +2660,11 @@ function createChatServer(local: BotGroupChatService, deps: BotGroupChatServiceD
if (i.name !== undefined || i.replyMode !== undefined || i.speakingMode !== undefined || organizerId !== undefined) await api(`/conversations/${i.groupId}`, 'PATCH', { operationId: randomUUID(), expectedRevision: i.expectedRevision ?? s.room.revision,
name: i.name, responseMode: i.replyMode, speakingMode: i.speakingMode, organizerId }, managementActor(s));
if (projectDir !== undefined) workspaces().save(i.groupId, { ...workspaces().read(i.groupId) ?? { plans: {} }, projectDir });
- changed(i.groupId); return { ok: true as const };
+ if (i.autoContinue !== undefined) workspaces().save(i.groupId, { projectDir: null, plans: {}, ...workspaces().read(i.groupId), autoContinue: i.autoContinue });
+ changed(i.groupId);
+ // Turned on while a step waits for 继续: go on now rather than at the next change.
+ if (i.autoContinue) autoContinuePlans(i.groupId);
+ return { ok: true as const };
}),
// Stop stops what is yours: your requests and arrangements, and your teammates' work for
// others. An owner or admin may stop everything (`all`). Work you may not stop is left running.
diff --git a/apps/desktop/src/main/maker-ipc/chatServerWorkspaces.ts b/apps/desktop/src/main/maker-ipc/chatServerWorkspaces.ts
index 194a4e391b..93e370cf8a 100644
--- a/apps/desktop/src/main/maker-ipc/chatServerWorkspaces.ts
+++ b/apps/desktop/src/main/maker-ipc/chatServerWorkspaces.ts
@@ -6,7 +6,8 @@ import { z } from 'zod';
import { ownerScopedUserDataPath } from '../appSessionState.js';
import { atomicWriteFileSync, readAtomicFileSync } from '../utils/atomicWriteFile.js';
const workspace = z.object({ workDir: z.string(), branch: z.string().nullable(), ownerSessionId: z.string().nullable() });
-const record = z.object({ projectDir: z.string().nullable(), plans: z.record(z.string(), workspace) });
+// autoContinue: 分工 started here go on to the next step by themselves (bot-group-chat.md §7.4).
+const record = z.object({ projectDir: z.string().nullable(), plans: z.record(z.string(), workspace), autoContinue: z.boolean().optional() });
export function chatServerWorkspaces(endpoint: string, actorId: string, current: () => boolean) {
const root = ownerScopedUserDataPath('chat-workspace-settings', createHash('sha256').update(`${endpoint}\n${actorId}`).digest('hex'));
const file = (room: string) => path.join(root, `${z.string().uuid().parse(room)}.json`);
diff --git a/apps/desktop/src/renderer/features/bots/BotGroupChatView.tsx b/apps/desktop/src/renderer/features/bots/BotGroupChatView.tsx
index 122cea4158..fdb34ef1b1 100644
--- a/apps/desktop/src/renderer/features/bots/BotGroupChatView.tsx
+++ b/apps/desktop/src/renderer/features/bots/BotGroupChatView.tsx
@@ -110,7 +110,7 @@ import {
mergeBotGroupPlans,
openBotGroupPlan,
} from './botGroupPresentation';
-import { botGroupApi, editBotGroupPlanStep, runBotGroupPlanAction, useBotGroupSummary } from './botGroupStore';
+import { botGroupApi, editBotGroupPlanStep, runBotGroupPlanAction, setBotGroupAutoContinue, useBotGroupSummary } from './botGroupStore';
import { botGroupReadKey, markBotRead } from './botReadState';
import {
beginBotGroupTimelineRead, discardBotGroupOutbox, getBotGroupOutboxClaims,
@@ -913,14 +913,26 @@ function BotGroupChatContent({ groupId }: { groupId: string }) {
}
};
+ const setAutoContinue = async (on: boolean) => {
+ try {
+ const result = await setBotGroupAutoContinue(groupId, on);
+ if (!result) return;
+ if (!result.ok) toast.error(t(botGroupErrorKey(result.errorCode, 'bots.groupChat.settings.autoContinueSaveFailed')));
+ loadRef.current();
+ } catch {
+ toast.error(t('bots.groupChat.settings.autoContinueSaveFailed'));
+ }
+ };
+
// Stable handlers for the memoized rows; each reads the latest page state through refs.
- const actionsRef = useRef({ locateQuoted, continueRound, runPlanAction, editPlanStep });
- actionsRef.current = { locateQuoted, continueRound, runPlanAction, editPlanStep };
+ const actionsRef = useRef({ locateQuoted, continueRound, runPlanAction, editPlanStep, setAutoContinue });
+ actionsRef.current = { locateQuoted, continueRound, runPlanAction, editPlanStep, setAutoContinue };
const onLocateQuote = useCallback((quote: BotGroupQuoteView) => void actionsRef.current.locateQuoted(quote), []);
const onContinue = useCallback(() => void actionsRef.current.continueRound(), []);
const onPlanAction = useCallback((action: 'start' | 'dismiss', planId: string) => void actionsRef.current.runPlanAction(action, planId), []);
const onEditStep = useCallback((planId: string, step: BotGroupPlanStepView, action: 'reassign' | 'remove', botId?: string) =>
void actionsRef.current.editPlanStep(planId, step, action, botId), []);
+ const onPlanAutoContinue = useCallback((_planId: string, on: boolean) => void actionsRef.current.setAutoContinue(on), []);
const onChanged = useCallback((messageId: string) => loadRef.current([], [messageId]), []);
const onQuote = useCallback((messageId: string) => {
const message = messageByIdRef.current.get(messageId);
@@ -1175,6 +1187,9 @@ function BotGroupChatContent({ groupId }: { groupId: string }) {
planDoneAt={message.planId ? planDoneAt.get(message.planId)?.value : undefined}
onPlanAction={onPlanAction}
onEditStep={onEditStep}
+ // The choice is the group's on this computer; the open 分工 you started shows it.
+ onPlanAutoContinue={isOpenPlanCard && plan?.autoContinue !== undefined && !group.archived && !group.dissolvedAt
+ ? onPlanAutoContinue : undefined}
/>
</Fragment>
);
diff --git a/apps/desktop/src/renderer/features/bots/BotGroupPlan.tsx b/apps/desktop/src/renderer/features/bots/BotGroupPlan.tsx
index 7afcfd7c2e..b33b659ef3 100644
--- a/apps/desktop/src/renderer/features/bots/BotGroupPlan.tsx
+++ b/apps/desktop/src/renderer/features/bots/BotGroupPlan.tsx
@@ -23,6 +23,7 @@ import {
DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu';
import { FileTypeIcon } from '@/components/ui/file-type-icon';
+import { Switch } from '@/components/ui/switch';
import { Tip } from '@/components/ui/tooltip';
import { MENU_ITEM_CLASS } from '@/features/cc-agent/sidebar/menuStyles';
import { toast } from '@/lib/toast';
@@ -291,6 +292,7 @@ export function BotGroupPlanCard({
onStart,
onDismiss,
onEditStep,
+ onAutoContinueChange,
}: {
plan: BotGroupPlanView | undefined;
members: readonly BotGroupMemberView[];
@@ -305,6 +307,8 @@ export function BotGroupPlanCard({
onStart: () => void;
onDismiss: () => void;
onEditStep: (step: BotGroupPlanStepView, action: 'reassign' | 'remove', botId?: string) => void;
+ /** Present for whoever may press 继续 on this open 分工: switch between waiting and going on by itself. */
+ onAutoContinueChange?: (on: boolean) => void;
}) {
const { t } = useTranslation();
const [expanded, setExpanded] = useState(false);
@@ -312,6 +316,7 @@ export function BotGroupPlanCard({
return <p className="text-12 text-[var(--text-tertiary)]">{t('bots.groupChat.plan.missing')}</p>;
}
const muted = plan.status === 'superseded' || plan.status === 'dismissed';
+ const autoContinue = plan.autoContinue;
const finalNote = FINAL_NOTE_KEYS[plan.status];
const busy = pending !== null;
const timing: StepTiming = { runningSince, doneAt, locale };
@@ -404,7 +409,20 @@ export function BotGroupPlanCard({
) : !arranged && (actionable || underWay) ? (
// Card footer: how it runs on the left, what the steps offer on the right.
<div className="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-0.5 border-t border-[var(--border-default)] px-3.5 py-1.5 text-11 leading-4 text-[var(--text-tertiary)]">
- <span className="min-w-0">{t('bots.groupChat.plan.pauseNote')}</span>
+ {onAutoContinueChange ? (
+ // Whoever may press 继续 chooses here, before or during the work (§7.4).
+ <label className="flex min-w-0 cursor-pointer items-center gap-2 text-12 leading-4 text-[var(--text-secondary)]">
+ <Switch
+ data-testid="bot-group-plan-auto"
+ checked={autoContinue === true}
+ disabled={busy}
+ onCheckedChange={onAutoContinueChange}
+ />
+ <span className="min-w-0">{t('bots.groupChat.plan.autoContinue')}</span>
+ </label>
+ ) : (
+ <span className="min-w-0">{t(autoContinue ? 'bots.groupChat.plan.autoNote' : 'bots.groupChat.plan.pauseNote')}</span>
+ )}
{actionable || canReassign ? (
<span className="ml-auto min-w-0 truncate">{t('bots.groupChat.plan.editHint')}</span>
) : null}
diff --git a/apps/desktop/src/renderer/features/bots/BotGroupTimelineItem.tsx b/apps/desktop/src/renderer/features/bots/BotGroupTimelineItem.tsx
index e301071539..7ac9b70ad7 100644
--- a/apps/desktop/src/renderer/features/bots/BotGroupTimelineItem.tsx
+++ b/apps/desktop/src/renderer/features/bots/BotGroupTimelineItem.tsx
@@ -276,6 +276,8 @@ export interface BotGroupTimelineItemProps {
onPlanAction?: (action: 'start' | 'dismiss', planId: string) => void;
readOnly?: boolean;
onEditStep?: (planId: string, step: BotGroupPlanStepView, action: 'reassign' | 'remove', botId?: string) => void;
+ /** Present on the open 分工 card for whoever may press 继续 (§7.4). */
+ onPlanAutoContinue?: (planId: string, on: boolean) => void;
}
function Row({ message, highlighted, focusable, entering, block, children }: {
@@ -530,6 +532,8 @@ function BotGroupTimelineItemImpl(props: BotGroupTimelineItemProps) {
onStart={() => { if (message.planId) props.onPlanAction?.('start', message.planId); }}
onDismiss={() => { if (message.planId) props.onPlanAction?.('dismiss', message.planId); }}
onEditStep={(step, action, botId) => { if (message.planId) props.onEditStep?.(message.planId, step, action, botId); }}
+ onAutoContinueChange={props.onPlanAutoContinue && message.planId
+ ? (on) => props.onPlanAutoContinue?.(message.planId!, on) : undefined}
/>
</div>
) : (
diff --git a/apps/desktop/src/renderer/features/bots/ChatGroupSettings.tsx b/apps/desktop/src/renderer/features/bots/ChatGroupSettings.tsx
index 9bd24a9017..9a1297c702 100644
--- a/apps/desktop/src/renderer/features/bots/ChatGroupSettings.tsx
+++ b/apps/desktop/src/renderer/features/bots/ChatGroupSettings.tsx
@@ -6,6 +6,7 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Select } from '@/components/ui/select';
import { FormField } from '@/components/ui/form-field';
+import { Switch } from '@/components/ui/switch';
import { useConfirmDialog } from '@/components/ui/confirm-dialog-provider';
import { ProfileEditDialog } from '@/components/settings/ProfileEditDialog';
import { getDataOwnerGeneration, isDataOwnerGenerationCurrent } from '@/contexts/dataOwnerGeneration';
@@ -99,14 +100,14 @@ export function ChatGroupSettings({ group }: { group: BotGroupSummary }) {
refreshBotGroups();
},
}), [group.id, me?.actorId, me?.name, me?.groupAvatar, me?.defaultAvatarUrl, t]);
- async function updateWorkSettings(input: { organizerBotId?: string; projectDir?: string | null }) {
+ async function updateWorkSettings(input: { organizerBotId?: string; projectDir?: string | null; autoContinue?: boolean }) {
if (busyRef.current) return;
busyRef.current = true; setBusy(true); setError('');
const generation = getDataOwnerGeneration();
try {
const result = await window.electronAPI.maker.updateBotGroup({ groupId: group.id, ...input });
if (!isDataOwnerGenerationCurrent(generation)) return;
- if (!result.ok) setError(t('bots.groupChat.settings.projectDirSaveFailed'));
+ if (!result.ok) setError(t('autoContinue' in input ? 'bots.groupChat.settings.autoContinueSaveFailed' : 'bots.groupChat.settings.projectDirSaveFailed'));
else refreshBotGroups();
} catch { if (isDataOwnerGenerationCurrent(generation)) setError(t(chatErrorKey('REQUEST_FAILED'))); }
finally { busyRef.current = false; if (mounted.current) setBusy(false); }
@@ -154,6 +155,13 @@ export function ChatGroupSettings({ group }: { group: BotGroupSummary }) {
{group.projectDir && <Button size="sm" variant="secondary" disabled={busy} onClick={() => void updateWorkSettings({ projectDir: null })}>{t('bots.groupChat.settings.projectDirClear')}</Button>}
<Button size="sm" variant="secondary" disabled={busy} onClick={() => void chooseProjectDir()}>{t('bots.groupChat.settings.projectDirChoose')}</Button>
</div>}</FormField>
+ {/* Kept on this computer like the project folder; only 分工 you start follow it (§7.4). */}
+ {group.autoContinue !== undefined && <FormField label={t('bots.groupChat.settings.handoff')} hint={t('bots.groupChat.settings.autoContinueNote')}>{() =>
+ <label className="flex w-fit cursor-pointer items-center gap-2.5 text-13 leading-5 text-[var(--text-primary)]">
+ <Switch data-testid="bot-group-auto-continue" checked={group.autoContinue === true} disabled={busy}
+ onCheckedChange={autoContinue => void updateWorkSettings({ autoContinue })} />
+ <span className="min-w-0">{t('bots.groupChat.plan.autoContinue')}</span>
+ </label>}</FormField>}
</section>
<section className="space-y-3 border-t border-[var(--border-default)] pt-5">
<div className="flex items-center justify-between gap-3">
diff --git a/apps/desktop/src/renderer/features/bots/botGroupStore.ts b/apps/desktop/src/renderer/features/bots/botGroupStore.ts
index b7c9cbe8fa..c54f58669a 100644
--- a/apps/desktop/src/renderer/features/bots/botGroupStore.ts
+++ b/apps/desktop/src/renderer/features/bots/botGroupStore.ts
@@ -219,6 +219,13 @@ export async function editBotGroupPlanStep(input: BotGroupPlanEditInput): Promis
return settlePlanMutation(() => api.editBotGroupPlanStep(input));
}
+/** Whether 分工 you start here go on by themselves; kept on this computer (§7.4). */
+export async function setBotGroupAutoContinue(groupId: string, autoContinue: boolean): Promise<BotGroupMutationResult | null> {
+ const api = botGroupApi();
+ if (!api || typeof api.updateBotGroup !== 'function') return NOT_READY;
+ return settlePlanMutation(() => api.updateBotGroup({ groupId, autoContinue }));
+}
+
async function settlePlanMutation(
run: () => Promise<BotGroupMutationResult>,
): Promise<BotGroupMutationResult | null> {
diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.json
index e363aad57e..375776b987 100644
--- a/apps/desktop/src/renderer/i18n/locales/en/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json
@@ -9601,6 +9601,9 @@
"projectDirChange": "Change Folder",
"projectDirClear": "Clear Folder",
"projectDirNote": "Teammates work here when they split the work. You can leave it empty and they’ll use this group chat’s own folder. If you choose a git project, each work split gets a new worktree and branch, so your own code stays untouched.",
+ "handoff": "Step handoffs",
+ "autoContinueNote": "When on, work splits you start in this group move on to the next step by themselves. When off, each step waits until you click “Start Next Step”. Applies on this computer only.",
+ "autoContinueSaveFailed": "Couldn’t save step handoffs. Try again.",
"projectDirSaveFailed": "Couldn’t save the project folder. Make sure the folder still exists, then try again."
},
"errors": {
@@ -9636,6 +9639,8 @@
"dismiss": "Skip Plan",
"editHint": "Click a step to hand it to someone else",
"pauseNote": "Work pauses after each step until you click “Start Next Step”.",
+ "autoContinue": "Start the next step automatically",
+ "autoNote": "Each finished step starts the next one automatically.",
"superseded": "Updated",
"dismissed": "Skipped",
"stopped": "Stopped",
diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.json
index cb237cce7a..04a4a4dbc4 100644
--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json
@@ -9567,6 +9567,9 @@
"projectDirChange": "フォルダを変更",
"projectDirClear": "クリア",
"projectDirNote": "役割分担で作業するとき、仲間はここで作業します。選ばなくてもかまいません。その場合はこのグループチャット専用のフォルダを使います。git プロジェクトを選ぶと、役割分担のたびに新しい worktree とブランチを作るので、手元のコードには触れません。",
+ "handoff": "ステップの引き継ぎ",
+ "autoContinueNote": "オンにすると、このグループであなたが始めた役割分担は、1 ステップ終わるたびに自動で次へ進みます。オフのときは各ステップで「次へ進む」を押すまで待ちます。このコンピュータでのみ有効です。",
+ "autoContinueSaveFailed": "ステップの引き継ぎを保存できませんでした。もう一度お試しください。",
"projectDirSaveFailed": "プロジェクトフォルダを保存できませんでした。フォルダがまだあるか確認してから、もう一度お試しください"
},
"errors": {
@@ -9602,6 +9605,8 @@
"dismiss": "今回はやめる",
"editHint": "ステップをクリックすると担当を変えられます",
"pauseNote": "1 ステップ終わるごとに止まり、「次へ進む」を押すまで待ちます。",
+ "autoContinue": "終わったら自動で次のステップへ",
+ "autoNote": "ステップが終わると自動で次へ進みます。",
"superseded": "更新済み",
"dismissed": "見送りました",
"stopped": "停止しました",
diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.json
index fcbafff06b..0972a02efe 100644
--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json
@@ -9567,6 +9567,9 @@
"projectDirChange": "폴더 변경",
"projectDirClear": "지우기",
"projectDirNote": "역할 분담으로 일할 때 동료들이 여기서 작업합니다. 선택하지 않아도 되며, 그러면 이 그룹 채팅 전용 폴더를 사용합니다. git 프로젝트를 선택하면 역할 분담마다 새 worktree와 브랜치를 만들어, 지금 작업 중인 코드는 건드리지 않습니다.",
+ "handoff": "단계 넘기기",
+ "autoContinueNote": "켜 두면 이 그룹에서 내가 시작한 역할 분담은 한 단계가 끝날 때마다 자동으로 다음 단계로 넘어갑니다. 끄면 단계마다 ‘다음 단계 시작’을 누를 때까지 기다립니다. 이 컴퓨터에서만 적용됩니다.",
+ "autoContinueSaveFailed": "단계 넘기기를 저장하지 못했습니다. 다시 시도해 주세요.",
"projectDirSaveFailed": "프로젝트 폴더를 저장하지 못했습니다. 폴더가 아직 있는지 확인한 뒤 다시 시도하세요"
},
"errors": {
@@ -9602,6 +9605,8 @@
"dismiss": "필요 없어요",
"editHint": "단계를 누르면 담당을 바꿀 수 있습니다",
"pauseNote": "한 단계가 끝날 때마다 멈추고, ‘다음 단계 시작’을 누를 때까지 기다립니다.",
+ "autoContinue": "끝나면 자동으로 다음 단계 시작",
+ "autoNote": "단계가 끝나면 자동으로 다음 단계가 시작됩니다.",
"superseded": "업데이트됨",
"dismissed": "사용 안 함",
"stopped": "중지됨",
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 283a079c79..5dabadbef9 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
@@ -9567,6 +9567,9 @@
"projectDirChange": "更换",
"projectDirClear": "清除",
"projectDirNote": "分工做事时,伙伴们在这里干活。不选也行,会用这个群自己的文件夹;选了 git 项目,每次分工会新开一个 worktree 和分支,不动你手上的代码。",
+ "handoff": "分工交接",
+ "autoContinueNote": "开着时,你在这个群发起的分工做完一步就自动交给下一位;关着时每一步都等你点「继续」。只在这台电脑上生效。",
+ "autoContinueSaveFailed": "分工交接没能保存,请再试一次",
"projectDirSaveFailed": "项目文件夹没能保存,确认文件夹还在后再试"
},
"errors": {
@@ -9602,6 +9605,8 @@
"dismiss": "不用了",
"editHint": "点某一步可以换人",
"pauseNote": "每做完一步会停下来,等你点「继续」。",
+ "autoContinue": "做完一步自动交给下一位",
+ "autoNote": "做完一步会自动交给下一位。",
"superseded": "已更新",
"dismissed": "不用了",
"stopped": "已停止",
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 45b3cab4d4..eb18e31795 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
@@ -9567,6 +9567,9 @@
"projectDirChange": "更換",
"projectDirClear": "清除",
"projectDirNote": "分工做事時,夥伴們在這裡工作。不選也行,會用這個群聊自己的資料夾;選了 git 專案,每次分工會新開一個 worktree 和分支,不動你手上的程式碼。",
+ "handoff": "分工交接",
+ "autoContinueNote": "開著時,你在這個群聊發起的分工做完一步就自動交給下一位;關著時每一步都等你點「繼續」。只在這台電腦上生效。",
+ "autoContinueSaveFailed": "分工交接沒能儲存,請再試一次",
"projectDirSaveFailed": "專案資料夾沒能儲存,確認資料夾還在後再試"
},
"errors": {
@@ -9602,6 +9605,8 @@
"dismiss": "不用了",
"editHint": "點某一步可以換人",
"pauseNote": "每做完一步會停下來,等你點「繼續」。",
+ "autoContinue": "做完一步自動交給下一位",
+ "autoNote": "做完一步會自動交給下一位。",
"superseded": "已更新",
"dismissed": "不用了",
"stopped": "已停止",
diff --git a/docs/product-rules/bot-group-chat.md b/docs/product-rules/bot-group-chat.md
index 097f1c8b09..3f30b8fe2f 100644
--- a/docs/product-rules/bot-group-chat.md
+++ b/docs/product-rules/bot-group-chat.md
@@ -25,7 +25,7 @@
| 阶段 | 范围 | 状态 |
| --- | --- | --- |
| 1 群聊基础 | 本机、同账号伙伴;建群、群里发言、@ 点名、继续讨论、停止、群设置;Desktop | 本文档 |
-| 2 分工 | 负责人伙伴出安排、用户点开始后伙伴一步步做;群工作目录(项目文件夹或群自己的文件夹,git 项目共用一个 worktree 与分支)、每步做完停下等继续 | 第 7 节 |
+| 2 分工 | 负责人伙伴出安排、用户点开始后伙伴一步步做;群工作目录(项目文件夹或群自己的文件夹,git 项目共用一个 worktree 与分支)、每步做完停下等继续(可在本机打开自动交接) | 第 7 节 |
| 3 手机端 | 手机查看与发言、分工操作、分工停下时推送 | 第 8 节 |
| Chat Server | 跨账号、跨区域的人与伙伴群聊 | 正式接线与旧群迁移补丁中;见第 10 节,需完成部署与存量操作兼容验收后发布 |
@@ -352,7 +352,8 @@ Chat Server 声明 `capabilities.groupSingleSpeaker: 1` 时,服务器群按下
- 一步一行:谁做、做什么。最多 6 步;同一位伙伴可以做多步,但相邻的几步由宿主合成一步(每一步都要停下等「继续」,
同一位伙伴连着做没有停的意义)。
- 「开始」「不用了」。开始前点某一步可以换成其他可用成员,或删掉这一步(至少留一步)。卡底一行小字写「每做完一步会停下来,
- 等你点「继续」」,可换人时右侧写「点某一步可以换人」。进行中的那一步写走动的已做时长,做完的步骤写完成时刻;
+ 等你点「继续」」(本机打开了自动交接时写「做完一步会自动交给下一位」),可换人时右侧写「点某一步可以换人」。
+ 在这台电脑发起的服务器群分工,卡底左侧改为开关「做完一步自动交给下一位」,开始前、进行中都能拨(见 7.4 自动交接)。进行中的那一步写走动的已做时长,做完的步骤写完成时刻;
每一步的交接消息在作者名字旁带「第 k 步」小标。
- 开始前用户不 @ 任何伙伴直接说话,视为修改意见:负责人按意见改出新的安排卡,旧卡标为已作废。
- 一个群同一时间最多一张未结束的安排(待开始、进行中、等继续);自动判断只在没有未结束安排时进行。
@@ -369,6 +370,11 @@ Chat Server 声明 `capabilities.groupSingleSpeaker: 1` 时,服务器群按下
非 git 按修改时间,最多列 20 个)附在消息下,点开用系统默认方式打开,只允许打开该安排工作目录内的文件。
- 之后群里普通接话时,交接消息连同这些文件的实际路径一起交给伙伴:文件在安排的工作目录里,不在伙伴自己的 Home。
- 做完停下:时间线出现「下一步:谁 做什么 · 继续」;最后一步做完出现「N 步都做完了」,安排结束。
+- 自动交接(服务器群,可选,默认关):群设置「分工交接」与安排卡底的开关是同一个设置,开着时**在这台电脑发起的**分工
+ 做完一步就由这台电脑像点「继续」一样交给下一位,不出现「继续」那一行。设置只存在本机(与项目文件夹相同,不同步到别的
+ 电脑或手机),别人发起的分工不受影响。这一步没做完(等「重试」)、分工已停止或最后一步做完时照常停下;等继续时打开
+ 开关立即交给下一位。交接以安排的版本号为准,别人先点了「继续」或改了安排,这次自动交接放弃,不会让一步做两次。
+ 这台电脑离线时不会自动交接,分工停在「继续」,有权限的人仍可手动继续。
- 等「继续」时用户不 @ 任何伙伴直接说话 = 让刚做完的伙伴按意见返工,返工完成后再出现「继续」。
- 正在做时用户不 @ 任何伙伴直接说话,这些话在本步当前回合结束后交给同一位伙伴继续做,全部处理完才算本步做完。
- 停止:输入框的停止结束整个分工,已完成的结果保留,群里提示已停止。
@@ -413,7 +419,7 @@ Chat Server 声明 `capabilities.groupSingleSpeaker: 1` 时,服务器群按下
电脑上的路径不离开电脑:项目文件夹只给文件夹名,安排的工作目录不下发。
- 手机可以:新建群、发言(@、@所有人、「+」安排分工)、停止、继续讨论、开始/不用了/继续/重试/结束分工、
开始前换人或删步骤、停下时给没做完的步骤换人、改群名/回复方式/发言方式/负责人、增删成员、删除群。
- **不能**选择或更换项目文件夹(只能在电脑上选)。
+ **不能**选择或更换项目文件夹,也不能切换分工的自动交接(两者都是电脑本机的设置,只能在电脑上改)。
- 只有全部成员都是手机可见的伙伴(未隐藏、未归档)时,群才出现在手机上;所有动作都重新核对。
- 旧电脑没有该 collection 时,手机不显示群聊入口。
diff --git a/packages/maker-shared/src/botGroupChat.ts b/packages/maker-shared/src/botGroupChat.ts
index 010e8f44d4..6623876c9a 100644
--- a/packages/maker-shared/src/botGroupChat.ts
+++ b/packages/maker-shared/src/botGroupChat.ts
@@ -386,6 +386,11 @@ export interface BotGroupPlanView {
canManage?: boolean;
/** Server groups: what the viewer sends without naming anyone goes to the step under way (creator, or a human owner/admin). */
canAdd?: boolean;
+ /**
+ * Server 分工: this computer starts the next step once one is done, instead of waiting for 继续.
+ * A choice of the computer that made it, not shared chat state; absent where unsupported.
+ */
+ autoContinue?: boolean;
createdAt: number;
updatedAt: number;
}
@@ -470,6 +475,11 @@ export interface BotGroupSummary {
organizerBotId: string | null;
/** 项目文件夹; null means the group's own folder. */
projectDir: string | null;
+ /**
+ * Server groups: 分工 you start here go on to the next step by themselves instead of waiting
+ * for 继续 (§7.4). Kept on this computer like the project folder; absent where unsupported.
+ */
+ autoContinue?: boolean;
lastMessage: BotGroupLastMessage | null;
/** Latest visible incoming message (Bot or another human), excluding self and runtime activity. Older hosts omit it. */
lastReplyAt?: number;
@@ -570,6 +580,8 @@ export interface BotGroupUpdateInput {
organizerBotId?: string | null;
/** Absolute existing local directory; null uses the group's own folder. */
projectDir?: string | null;
+ /** Server groups: whether 分工 you start go on by themselves (kept on this computer). */
+ autoContinue?: boolean;
}
export interface BotGroupSetMembersInput {