Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
feat(desktop): fold long queues, first five turns run by themselves
zqchris8ad1aac627ad
diff --git a/apps/desktop/scripts/fixtures/group-control/group-control-fixture.tsx b/apps/desktop/scripts/fixtures/group-control/group-control-fixture.tsxindex 9cd7d05eb9..c03b06f8b2 100644--- a/apps/desktop/scripts/fixtures/group-control/group-control-fixture.tsx+++ b/apps/desktop/scripts/fixtures/group-control/group-control-fixture.tsx@@ -16,7 +16,7 @@ interface GroupData {bubbles?: boolean;wrappedReactions?: boolean;/** A single-speaker server group: nobody was named, so everyone answers in turn (bot-group-chat.md §4.0/§7.0). */- arrangement?: 'waiting' | 'auto';+ arrangement?: Queue;/** Open the group settings drawer as its owner. */settings?: boolean;}@@ -110,26 +110,44 @@ function bubbleMessages(wrappedReactions = false) {];}+type Queue = 'running' | 'done' | 'long';+const QUEUE_ANSWERS = [+ '我倾向于改:群里会安静很多,也更省。',+ '同意。测试上要覆盖 @ 多位时按顺序回答,以及老群升级后只留一次说明。',+ '手机端也要跟上,不然两边看到的不一样。',+ '队列卡别太长,折起来就行。',+ '我没什么补充,按这个做。',+];+/** Who a queue lines up: the two-teammate group, or seven teammates for a long queue. */+const QUEUE_CROWD = ['Aster', 'Nova', 'Mira', 'Orin', 'Pax', 'Quill', 'Rhea'].map((name, i) => ({ botId: 'abcdefg'[i]!, name }));+const queueMembers = (state: Queue) => QUEUE_CROWD.slice(0, state === 'long' ? 7 : 2);+/** How many turns have answered: Nova still speaking, everyone, or the five that run by themselves. */+const queueAnswered = (state: Queue) => (state === 'running' ? 1 : state === 'done' ? 2 : 5);+/** Nobody named: the queue card, then each teammate's own answer in turn. */-function arrangementMessages(state: 'waiting' | 'auto') {+function arrangementMessages(state: Queue) {const ask = '群聊改成每条只有一位回答,大家讨论下?';return [message({ id: 'q1', sequence: 1, isSelf: true, content: ask, createdAt: T0 }),message({ id: 'p1-card', sequence: 2, kind: 'plan', planId: 'p1', isSelf: true, content: '', createdAt: T0 }),- message({ id: 'a1', sequence: 3, authorKind: 'bot', authorBotId: 'a', authorName: 'Aster', planId: 'p1', createdAt: T0 + MINUTE,- content: '我倾向于改:群里会安静很多,也更省。' }),- ...(state === 'auto' ? [message({ id: 'b1', sequence: 4, authorKind: 'bot', authorBotId: 'b', authorName: 'Nova', planId: 'p1', createdAt: T0 + 2 * MINUTE,- content: '同意。测试上要覆盖 @ 多位时按顺序回答,以及老群升级后只留一次说明。' })] : []),+ ...queueMembers(state).slice(0, queueAnswered(state)).map((member, i) => message({+ id: `${member.botId}1`, sequence: 3 + i, authorKind: 'bot', authorBotId: member.botId, authorName: member.name, planId: 'p1',+ createdAt: T0 + (i + 1) * MINUTE, content: QUEUE_ANSWERS[i] })),];}-function arrangementPlan(state: 'waiting' | 'auto') {+function arrangementPlan(state: Queue) {+ const answered = queueAnswered(state);+ const members = queueMembers(state);return {- id: 'p1', status: state === 'auto' ? 'done' : 'waiting', organizerBotId: 'a', organizerName: 'Aster', currentStep: state === 'auto' ? 1 : 0,- kind: 'talk', autoContinue: state === 'auto', canManage: true, workDir: null, branch: null, createdAt: T0, updatedAt: T0 + 2 * MINUTE,- steps: [- { position: 0, botId: 'a', botName: 'Aster', task: '', status: 'done', resultMessageId: 'a1' },- { position: 1, botId: 'b', botName: 'Nova', task: '', status: state === 'auto' ? 'done' : 'pending', resultMessageId: state === 'auto' ? 'b1' : null },- ],+ id: 'p1', status: state === 'done' ? 'done' : state === 'long' ? 'waiting' : 'running', organizerBotId: 'a', organizerName: 'Aster',+ currentStep: state === 'long' ? answered - 1 : state === 'done' ? 1 : answered,+ // A running turn is timed from the plan's last change: keep it recent so the clock reads sensibly.+ kind: 'talk', canManage: true, workDir: null, branch: null, createdAt: T0, updatedAt: state === 'running' ? Date.now() - 30_000 : T0 + answered * MINUTE,+ steps: members.map((member, position) => ({+ position, botId: member.botId, botName: member.name, task: '',+ status: position < answered ? 'done' : position === answered && state === 'running' ? 'running' : 'pending',+ resultMessageId: position < answered ? `${member.botId}1` : null,+ })),};}@@ -157,8 +175,9 @@ function groupFrom(data: GroupData) {createdAt: 1,updatedAt: 1,plans: data.arrangement ? [arrangementPlan(data.arrangement)] : [],- ...(data.arrangement ? { openPlan: data.arrangement === 'waiting'- ? { id: 'p1', status: 'waiting', currentStep: 0, stepCount: 2, currentBotName: 'Aster', currentStepStatus: 'done' } : null,+ ...(data.arrangement ? { openPlan: data.arrangement === 'long'+ ? { id: 'p1', status: 'waiting', currentStep: 4, stepCount: 7, currentBotName: 'Pax', currentStepStatus: 'done', kind: 'talk' }+ : data.arrangement === 'running' ? { id: 'p1', status: 'running', currentStep: 1, stepCount: 2, currentBotName: 'Nova', currentStepStatus: 'running', kind: 'talk' } : null,singleSpeaker: true } : {}),...(data.bubbles || data.arrangement ? { serverBacked: true } : {}),messages: data.arrangement ? arrangementMessages(data.arrangement) : data.bubbles ? bubbleMessages(data.wrappedReactions) : Array.from({ length: data.messages }, (_, i) => ({diff --git a/apps/desktop/scripts/fixtures/group-control/ui-page.mjs b/apps/desktop/scripts/fixtures/group-control/ui-page.mjsindex 9a294482b0..65ab614d0c 100644--- a/apps/desktop/scripts/fixtures/group-control/ui-page.mjs+++ b/apps/desktop/scripts/fixtures/group-control/ui-page.mjs@@ -5,6 +5,7 @@ const members = [{ botId: 'b', name: 'Nova' },];const base = { name: 'Design review', members, messages: 0, sidebar: true };+const QUEUE_CROWD = ['Aster', 'Nova', 'Mira', 'Orin', 'Pax', 'Quill', 'Rhea'].map((name, i) => ({ botId: 'abcdefg'[i], name }));const LONG_DEVICE = 'Mac Studio · A very long device name for layout verification';/** Migrated from check-group-control-layout.mjs (remote-control notice above the composer). */@@ -34,16 +35,20 @@ export default {data: { ...base, bubbles: true },},arrangement: {- about: 'Single-speaker server group, nobody named: the queue card stands on its own, the first teammate answers, then it waits for 继续; its owner can turn on 自动接下一位',- data: { ...base, arrangement: 'waiting' },+ about: 'Single-speaker server group, nobody named: the queue card stands on its own, Aster answered and Nova is speaking next by itself',+ data: { ...base, arrangement: 'running' },},'arrangement-done': {- about: 'The same discussion once every turn is done: no switch or 继续 row, the turn reply carries 第 2 步',- data: { ...base, arrangement: 'auto' },+ about: 'The same queue once every turn is done: no 继续 row',+ data: { ...base, arrangement: 'done' },+ },+ 'arrangement-long': {+ 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' },},settings: {about: 'Single-speaker group settings: no 回复方式, 发言方式, 负责人 or project folder',- data: { ...base, arrangement: 'waiting', settings: true },+ data: { ...base, arrangement: 'running', settings: true },},'bubbles-wrapped': {about: 'PR #6549: wrapped reactions keep both toolbars level with their bubbles; server messages with empty mention ids still open unique member cards',@@ -93,9 +98,12 @@ export default {await card.waitFor();// The card is its own row, never part of a teammate's answer.assert.equal(await card.locator('xpath=ancestor::article').count(), 0);- // The owner sees 自动接下一位 only while the arrangement is open.- assert.equal(await page.getByRole('switch').count(), ui.case === 'arrangement' ? 1 : 0);- assert.equal(await page.getByTestId('bot-group-plan-follow-up').count(), ui.case === 'arrangement' ? 1 : 0);+ // Only a queue past its first five waits for 继续; a long queue folds to three turns until expanded.+ assert.equal(await page.getByTestId('bot-group-plan-follow-up').count(), ui.case === 'arrangement-long' ? 1 : 0);+ assert.equal(await card.locator('li').count(), ui.case === 'arrangement-long' ? 3 : 2);+ // A queue waiting for 继续 takes a new request: the composer does not offer to revise the last answer.+ const placeholder = await input.getAttribute('placeholder');+ assert.ok(ui.case === 'arrangement' ? placeholder.includes('正在说') : !placeholder.includes('改改'), placeholder);return;}if (ui.case.startsWith('bubbles')) {diff --git a/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.tsindex 37ae19573a..e9766370f6 100644--- a/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts+++ b/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts@@ -1378,7 +1378,7 @@ describe('Chat Server result delivery and refresh', () => {const planId = '80000000-0000-4000-8000-000000000001';const answerId = '50000000-0000-4000-8000-000000000011', noteId = '50000000-0000-4000-8000-000000000012';const plan = { id: planId, revision: 3, source_message_id: execution.source_message_id, request_text: 'One reply per message?', organizer_id: otherBot, creator_id: selfId,- note_message_ids: [noteId], status: 'running', current_step: 1, kind: 'talk', auto_continue: false, created_at: '2026-10-03T00:00:00Z', updated_at: '2026-10-03T00:00:00Z',+ note_message_ids: [noteId], status: 'running', current_step: 1, kind: 'talk', created_at: '2026-10-03T00:00:00Z', updated_at: '2026-10-03T00:00:00Z',steps: [{ position: 0, botId: otherBot, botName: 'Peer', task: '', status: 'done', resultMessageId: answerId }, { position: 1, botId, botName: 'Bot', task: 'tests', status: 'running' }] };singleSpeaker((route, _method, body) => {if (route === '/executions/claim' && !claimed) { claimed = true; return { body: { execution: { ...execution, access_mode: 'owner', plan_id: planId, plan_step: 1 } } }; }@@ -1413,7 +1413,7 @@ describe('Chat Server result delivery and refresh', () => {['mid-turn: the words go to the teammate answering', 'running', `/conversations/${roomId}/plans/80000000-0000-4000-8000-000000000002/messages`],] as const)('with an open queue %s', async (_label, status, route) => {const queue = { id: '80000000-0000-4000-8000-000000000002', revision: 1, source_message_id: execution.source_message_id, request_text: 'Q', organizer_id: botId,- creator_id: selfId, note_message_ids: [], status, current_step: 0, kind: 'talk', auto_continue: false, created_at: '2026-10-03T00:00:00Z', updated_at: '2026-10-03T00:00:00Z',+ creator_id: selfId, note_message_ids: [], status, current_step: 0, kind: 'talk', created_at: '2026-10-03T00:00:00Z', updated_at: '2026-10-03T00:00:00Z',steps: [{ position: 0, botId, botName: 'Bot', task: '', status: status === 'waiting' ? 'done' : 'running' }, { position: 1, botId: otherBot, botName: 'Peer', task: '', status: 'pending' }] };singleSpeaker(route => route === `/conversations/${roomId}/plans` ? { body: [queue] } : undefined);expect(await service.sendMessage({ groupId: roomId, text: 'Another thing', clientId: `queue-${status}`, mentions: { all: false, botIds: [] } }))diff --git a/apps/desktop/src/main/maker-ipc/botGroupChatService.ts b/apps/desktop/src/main/maker-ipc/botGroupChatService.tsindex 09b1233c38..a4b4abb998 100644--- a/apps/desktop/src/main/maker-ipc/botGroupChatService.ts+++ b/apps/desktop/src/main/maker-ipc/botGroupChatService.ts@@ -2180,8 +2180,6 @@ export function createBotGroupChatService(deps: BotGroupChatServiceDeps) {continuePlan: (input: unknown) => planAction('continue', input),retryPlan: (input: unknown) => planAction('retry', input),editPlanStep,- /** Auto-continue belongs to server arrangements; local plans always wait for 继续. */- setPlanAuto: async (_input: unknown): Promise<BotGroupMutationResult> => ({ ok: false, errorCode: 'PLAN_CLOSED', message: 'local plans wait for continue' }),settleLaneTurn,/** Only a server room has a message channel a teammate can post into outside a turn. */postCompanionTaskMessage: async (_input: BotGroupTaskPostInput): Promise<BotGroupTaskPostResult> =>diff --git a/apps/desktop/src/main/maker-ipc/channels.ts b/apps/desktop/src/main/maker-ipc/channels.tsindex 3dffa64a8f..e7454e0928 100644--- a/apps/desktop/src/main/maker-ipc/channels.ts+++ b/apps/desktop/src/main/maker-ipc/channels.ts@@ -831,7 +831,6 @@ export const MAKER_INVOKE = {BOT_GROUP_PLAN_CONTINUE: 'maker:bot-group:plan-continue',BOT_GROUP_PLAN_RETRY: 'maker:bot-group:plan-retry',BOT_GROUP_PLAN_EDIT: 'maker:bot-group:plan-edit',- BOT_GROUP_PLAN_AUTO: 'maker:bot-group:plan-auto',BOT_LIFECYCLE_ACTION: 'maker:bot-lifecycle:action',/** Where each companion runs (cloud-companions.md §3); read-only snapshot. */COMPANION_CLOUD_STATE: 'maker:companion-cloud:state',diff --git a/apps/desktop/src/main/maker-ipc/chatServer.ts b/apps/desktop/src/main/maker-ipc/chatServer.tsindex 7217f8ff3f..29ae7ef2d6 100644--- a/apps/desktop/src/main/maker-ipc/chatServer.ts+++ b/apps/desktop/src/main/maker-ipc/chatServer.ts@@ -76,8 +76,8 @@ interface ServerPlan {id: string; revision: number; source_message_id: string; request_text: string; organizer_id: string; creator_id: string;note_message_ids?: string[];status: BotGroupPlanView['status']; current_step: number | null; steps: Array<BotGroupPlanView['steps'][number] & { resultMessageId?: string | null }>;- /** Servers with groupSingleSpeaker: a discussion (`talk`) or a division of work, and whether it advances on its own. */- kind?: 'work' | 'talk'; auto_continue?: boolean;+ /** Servers with groupSingleSpeaker: a queue of teammates answering in turn (`talk`) or a division of work. */+ kind?: 'work' | 'talk';created_at: string; updated_at: string;}interface Running {@@ -290,7 +290,6 @@ export function withChatServer(local: BotGroupChatService, deps: BotGroupChatSercontinuePlan: (...args) => service().continuePlan(...args),retryPlan: (...args) => service().retryPlan(...args),editPlanStep: (...args) => service().editPlanStep(...args),- setPlanAuto: (...args) => service().setPlanAuto(...args),settleLaneTurn: (...args) => service().settleLaneTurn(...args),postCompanionTaskMessage: (...args) => service().postCompanionTaskMessage(...args),hasCompanionTaskChannel: (...args) => service().hasCompanionTaskChannel(...args),@@ -1196,7 +1195,7 @@ function createChatServer(local: BotGroupChatService, deps: BotGroupChatServiceD}), organizerBotId: s.room.organizer_id ? localBot(s.room.organizer_id)?.id ?? s.room.organizer_id : s.members.find(m => m.kind === 'bot' && m.state === 'joined')?.id ?? null, projectDir: workspace?.projectDir ?? null, 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 } : null,+ } : 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,lastReplyAt: s.messages.reduce((latest, m) => !m.deleted && m.origin !== 'system' && m.authorId !== selfId? Math.max(latest, Date.parse(m.createdAt)) : latest, 0),incomingMessageTimes: incomingMessageTimes(s.messages, s.members),@@ -1212,7 +1211,7 @@ function createChatServer(local: BotGroupChatService, deps: BotGroupChatServiceDorganizerName: members.find(m => m.id === plan.organizer_id)?.name ?? '',steps: plan.steps.map(s => ({ ...s, botId: localBot(s.botId)?.id ?? s.botId })), currentStep: plan.current_step,workDir: workspace?.plans[plan.id]?.workDir ?? null, branch: workspace?.plans[plan.id]?.branch ?? null,- ...(plan.kind ? { kind: plan.kind, autoContinue: plan.auto_continue === true,+ ...(plan.kind ? { kind: plan.kind,canManage: plan.creator_id === selfId || members.some(m => m.id === selfId && ['owner', 'admin'].includes(m.role)) } : {}),createdAt: Date.parse(plan.created_at), updatedAt: Date.parse(plan.updated_at) };}@@ -2370,15 +2369,6 @@ function createChatServer(local: BotGroupChatService, deps: BotGroupChatServiceD}),startPlan: input => safe(() => actPlan(input, 'start')), dismissPlan: input => safe(() => actPlan(input, 'dismiss')),continuePlan: input => safe(() => actPlan(input, 'continue')), retryPlan: input => safe(() => actPlan(input, 'retry')),- setPlanAuto: input => safe(async () => {- const i = z.object({ groupId: id, planId: id, autoContinue: z.boolean() }).parse(input);- if (!singleSpeaker) throw new Error('UNSUPPORTED');- const room = await groupRoom(i.groupId);- const plan = (await api<ServerPlan[]>(`/conversations/${room}/plans?ids=${i.planId}`)).find(p => p.id === i.planId);- if (!plan) throw new Error('PLAN_CLOSED');- await api(`/conversations/${room}/plans/${plan.id}`, 'POST', { operationId: randomUUID(), expectedRevision: plan.revision, action: 'auto', autoContinue: i.autoContinue });- changed(room); return { ok: true as const };- }),editPlanStep: input => safe(() => actPlan(input, 'reassign')),dispose: () => {disposed = true; threads.dispose(); clearInterval(timer); clearInterval(heartbeat); clearTimeout(reconnect); clearTimeout(claimTrigger); socket?.close();diff --git a/apps/desktop/src/main/maker-ipc/register.ts b/apps/desktop/src/main/maker-ipc/register.tsindex c68c6aee1f..bbf86959ed 100644--- a/apps/desktop/src/main/maker-ipc/register.ts+++ b/apps/desktop/src/main/maker-ipc/register.ts@@ -12797,10 +12797,6 @@ export function registerMakerIpc(maker: Maker, options: RegisterMakerIpcOptions)assertTrustedAppRendererEvent(event);return botGroupChatServiceHolder ? botGroupChatServiceHolder.retryPlan(input) : botGroupNotReady;});- ipcMain.handle(MAKER_INVOKE.BOT_GROUP_PLAN_AUTO, async (event, input: unknown) => {- assertTrustedAppRendererEvent(event);- return botGroupChatServiceHolder ? botGroupChatServiceHolder.setPlanAuto(input) : botGroupNotReady;- });ipcMain.handle(MAKER_INVOKE.BOT_GROUP_PLAN_EDIT, async (event, input: unknown) => {assertTrustedAppRendererEvent(event);return botGroupChatServiceHolder ? botGroupChatServiceHolder.editPlanStep(input) : botGroupNotReady;diff --git a/apps/desktop/src/preload/preload.ts b/apps/desktop/src/preload/preload.tsindex 3ef5f8f20f..eb8e650bda 100644--- a/apps/desktop/src/preload/preload.ts+++ b/apps/desktop/src/preload/preload.ts@@ -6257,10 +6257,6 @@ contextBridge.exposeInMainWorld('electronAPI', {input: import('../shared/botGroupChat').BotGroupPlanEditInput,): Promise<import('../shared/botGroupChat').BotGroupMutationResult> =>ipcRenderer.invoke('maker:bot-group:plan-edit', input),- setBotGroupPlanAuto: (- input: import('../shared/botGroupChat').BotGroupPlanAutoInput,- ): Promise<import('../shared/botGroupChat').BotGroupMutationResult> =>- ipcRenderer.invoke('maker:bot-group:plan-auto', input),onBotGroupChanged: fanOutBotGroupChanged,getCompanionCloudState: (): Promise<import('../shared/companionCloud').CompanionCloudSnapshot> =>ipcRenderer.invoke('maker:companion-cloud:state'),diff --git a/apps/desktop/src/renderer/features/bots/BotGroupChatView.tsx b/apps/desktop/src/renderer/features/bots/BotGroupChatView.tsxindex 18db81b80a..7bba3e5042 100644--- a/apps/desktop/src/renderer/features/bots/BotGroupChatView.tsx+++ b/apps/desktop/src/renderer/features/bots/BotGroupChatView.tsx@@ -107,7 +107,7 @@ import {mergeBotGroupPlans,openBotGroupPlan,} from './botGroupPresentation';-import { botGroupApi, editBotGroupPlanStep, runBotGroupPlanAction, setBotGroupPlanAuto, useBotGroupSummary } from './botGroupStore';+import { botGroupApi, editBotGroupPlanStep, runBotGroupPlanAction, useBotGroupSummary } from './botGroupStore';import { botGroupReadKey, markBotRead } from './botReadState';import {beginBotGroupTimelineRead, discardBotGroupOutbox, getBotGroupOutboxClaims,@@ -129,7 +129,7 @@ const PLAN_ACTION_FAILED: Record<BotGroupPlanAction, string> = {retry: 'bots.groupChat.timeline.retryFailed',};-type PlanPending = { planId: string; action: BotGroupPlanAction | 'edit' | 'auto' };+type PlanPending = { planId: string; action: BotGroupPlanAction | 'edit' };/** A read that lands within this needs no progress indicator, so a fast switch does not flash. */const TIMELINE_LOADING_REVEAL_MS = 200;@@ -905,32 +905,14 @@ function BotGroupChatContent({ groupId }: { groupId: string }) {}};- const setPlanAuto = async (planId: string, autoContinue: boolean) => {- if (planPendingRef.current) return;- planPendingRef.current = true;- setPlanPending({ planId, action: 'auto' });- try {- const result = await setBotGroupPlanAuto({ groupId, planId, autoContinue });- if (!result) return;- if (!result.ok) toast.error(t(botGroupErrorKey(result.errorCode, 'bots.groupChat.plan.autoFailed')));- loadRef.current();- } catch {- toast.error(t('bots.groupChat.plan.autoFailed'));- } finally {- planPendingRef.current = false;- setPlanPending(null);- }- };-// Stable handlers for the memoized rows; each reads the latest page state through refs.- const actionsRef = useRef({ locateQuoted, continueRound, runPlanAction, editPlanStep, setPlanAuto });- actionsRef.current = { locateQuoted, continueRound, runPlanAction, editPlanStep, setPlanAuto };+ const actionsRef = useRef({ locateQuoted, continueRound, runPlanAction, editPlanStep });+ actionsRef.current = { locateQuoted, continueRound, runPlanAction, editPlanStep };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 onPlanAuto = useCallback((planId: string, on: boolean) => void actionsRef.current.setPlanAuto(planId, on), []);const onChanged = useCallback((messageId: string) => loadRef.current([], [messageId]), []);const onQuote = useCallback((messageId: string) => {const message = messageByIdRef.current.get(messageId);@@ -1185,13 +1167,11 @@ function BotGroupChatContent({ groupId }: { groupId: string }) {planDoneAt={message.planId ? planDoneAt.get(message.planId)?.value : undefined}onPlanAction={onPlanAction}onEditStep={onEditStep}- planAutoPending={pendingFor(message.planId) === 'auto'}- onPlanAuto={onPlanAuto}/></Fragment>);})}- {openPlan && followUp && !(openPlan.autoContinue && followUp.kind === 'continue') && (openPlan.canManage ?? true) ? (+ {openPlan && followUp && (openPlan.canManage ?? true) ? (<div className="mt-3"><BotGroupPlanFollowUpRowtalk={openPlan.kind === 'talk'}diff --git a/apps/desktop/src/renderer/features/bots/BotGroupComposer.tsx b/apps/desktop/src/renderer/features/bots/BotGroupComposer.tsxindex df973f4eb5..0045d0fb72 100644--- a/apps/desktop/src/renderer/features/bots/BotGroupComposer.tsx+++ b/apps/desktop/src/renderer/features/bots/BotGroupComposer.tsx@@ -507,7 +507,7 @@ export function BotGroupComposer({: planState?.kind === 'proposed'? t('bots.groupChat.composer.placeholderPlanProposed'): planState?.kind === 'running' && planState.botName- ? t('bots.groupChat.composer.placeholderPlanRunning', { name: planState.botName })+ ? t(planState.talk ? 'bots.groupChat.composer.placeholderQueueRunning' : 'bots.groupChat.composer.placeholderPlanRunning', { name: planState.botName }): planState?.kind === 'waiting' && planState.stepDone && planState.botName? t('bots.groupChat.composer.placeholderPlanWaiting', { name: planState.botName }): t('bots.groupChat.composer.placeholder');diff --git a/apps/desktop/src/renderer/features/bots/BotGroupLiveStatus.tsx b/apps/desktop/src/renderer/features/bots/BotGroupLiveStatus.tsxindex 6014be8a34..70f85e19b6 100644--- a/apps/desktop/src/renderer/features/bots/BotGroupLiveStatus.tsx+++ b/apps/desktop/src/renderer/features/bots/BotGroupLiveStatus.tsx@@ -229,6 +229,8 @@ export function botGroupHeaderStatus(};const plan = group.openPlan;if (plan?.status === 'running' && plan.currentStep !== null && plan.currentStepStatus === 'running') {+ // A queue's turn is someone speaking, not a step of work.+ if (plan.kind === 'talk') return t('bots.groupChat.header.speaking', { name: plan.currentBotName?.trim() || '' });return t('bots.groupChat.header.stepRunning', { name: plan.currentBotName?.trim() || '', step: plan.currentStep + 1 });}if (group.planningBotId) return t('bots.groupChat.header.planning', { name: nameOf(group.planningBotId) });diff --git a/apps/desktop/src/renderer/features/bots/BotGroupPlan.tsx b/apps/desktop/src/renderer/features/bots/BotGroupPlan.tsxindex 5e0d38b311..5be2e8f197 100644--- a/apps/desktop/src/renderer/features/bots/BotGroupPlan.tsx+++ b/apps/desktop/src/renderer/features/bots/BotGroupPlan.tsx@@ -9,12 +9,11 @@** 交接文件相对安排的工作目录;点开交给系统默认方式,路径越出工作目录的一律不打开。*/-import type { ReactNode } from 'react';-import { Check, CircleAlert, CircleCheck, CircleDashed, Sparkles } from 'lucide-react';+import { useState, type ReactNode } from 'react';+import { Check, ChevronDown, ChevronUp, CircleAlert, CircleCheck, CircleDashed, Sparkles } from 'lucide-react';import { useTranslation } from 'react-i18next';import { Button } from '@/components/ui/button';-import { Switch } from '@/components/ui/switch';import {DropdownMenu,DropdownMenuContent,@@ -260,10 +259,23 @@ const FINAL_NOTE_KEYS: Partial<Record<BotGroupPlanView['status'], string>> = {stopped: 'bots.groupChat.plan.stopped',};+/** A long queue shows this many turns around the current one until it is expanded. */+const QUEUE_VISIBLE_STEPS = 3;++/** The turns a folded queue shows: the one before the current turn, it, and the next. */+export function botGroupQueueWindow(plan: BotGroupPlanView): { start: number; end: number } {+ const count = plan.steps.length;+ // Folding away a single turn saves nothing.+ if (count <= QUEUE_VISIBLE_STEPS + 1) return { start: 0, end: count };+ const active = plan.steps.findIndex((step) => step.status !== 'done');+ const start = Math.min(Math.max((active < 0 ? count - 1 : active) - 1, 0), count - QUEUE_VISIBLE_STEPS);+ return { start, end: start + QUEUE_VISIBLE_STEPS };+}+/*** Body of the 安排卡. A legacy plan is the organizer's message (the usual Bot header plus the- * 负责人 tag). A server arrangement (`plan.kind`) stands on its own under the request or the- * lead's answer: only its steps, and whether the next one starts by itself.+ * 负责人 tag). A server queue (`plan.kind`) stands on its own under the request: only its turns,+ * folded to a few around the current one.* `actionable` = the group's open plan, still waiting for 开始;* `reassignable` = the open plan stopped after a step (steps not done can change hands).*/@@ -279,8 +291,6 @@ export function BotGroupPlanCard({onStart,onDismiss,onEditStep,- autoPending = false,- onAutoContinue,}: {plan: BotGroupPlanView | undefined;members: readonly BotGroupMemberView[];@@ -295,10 +305,9 @@ export function BotGroupPlanCard({onStart: () => void;onDismiss: () => void;onEditStep: (step: BotGroupPlanStepView, action: 'reassign' | 'remove', botId?: string) => void;- autoPending?: boolean;- onAutoContinue?: (on: boolean) => void;}) {const { t } = useTranslation();+ const [expanded, setExpanded] = useState(false);if (!plan) {return <p className="text-12 text-[var(--text-tertiary)]">{t('bots.groupChat.plan.missing')}</p>;}@@ -309,6 +318,9 @@ export function BotGroupPlanCard({const canReassign = reassignable && plan.steps.some((step) => step.status === 'pending' || step.status === 'failed');const underWay = plan.status === 'running' || plan.status === 'waiting';const arranged = plan.kind !== undefined;+ const turns = arranged ? botGroupQueueWindow(plan) : { start: 0, end: plan.steps.length };+ const folded = !expanded && turns.end - turns.start < plan.steps.length;+ const shown = folded ? plan.steps.slice(turns.start, turns.end) : plan.steps;return (<div data-testid="bot-group-plan" data-plan-status={plan.status} data-plan-kind={plan.kind} className="flex min-w-0 flex-col">{arranged ? null : (@@ -320,7 +332,8 @@ export function BotGroupPlanCard({// A legacy plan sits inside the organizer's bubble; an arrangement is its own card.arranged ? 'rounded-xl border border-[var(--border-default)] bg-[var(--surface-elevated)]' : 'mt-2 rounded-lg bg-[var(--surface)]')}><ol className="flex flex-col py-1.5">- {plan.steps.map((step, index) => {+ {shown.map((step, shownIndex) => {+ const index = folded ? turns.start + shownIndex : shownIndex;const identity = stepIdentity(step, members);const editable =actionable || (reassignable && (step.status === 'pending' || step.status === 'failed'));@@ -374,14 +387,19 @@ export function BotGroupPlanCard({</Button></div>) : null}- {arranged && underWay && plan.canManage && onAutoContinue ? (- // An arrangement waits for 继续 after each turn unless its owner lets it run on.- <label className="flex min-w-0 cursor-pointer select-none items-center gap-2 border-t border-[var(--border-default)] px-3.5 py-1.5 text-12 leading-4 text-[var(--text-secondary)]">- <Switch checked={plan.autoContinue === true} disabled={autoPending}- aria-label={t('bots.groupChat.plan.autoContinue')} onCheckedChange={onAutoContinue} />- <span className="min-w-0">{t('bots.groupChat.plan.autoContinue')}</span>- {canReassign ? <span className="ml-auto min-w-0 truncate text-11 text-[var(--text-tertiary)]">{t('bots.groupChat.plan.editHint')}</span> : null}- </label>+ {arranged && turns.end - turns.start < plan.steps.length ? (+ <button+ type="button"+ data-testid="bot-group-plan-fold"+ aria-expanded={expanded}+ onClick={() => setExpanded((open) => !open)}+ className="flex w-full min-w-0 items-center gap-1 border-t border-[var(--border-default)] px-3.5 py-1.5 text-left text-12 leading-4 text-[var(--text-secondary)] hover:text-[var(--text-primary)]"+ >+ <span className="min-w-0">+ {expanded ? t('bots.groupChat.plan.foldTurns') : t('bots.groupChat.plan.allTurns', { count: plan.steps.length })}+ </span>+ {expanded ? <ChevronUp size={12} aria-hidden /> : <ChevronDown size={12} aria-hidden />}+ </button>) : !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)]">diff --git a/apps/desktop/src/renderer/features/bots/BotGroupTimelineItem.tsx b/apps/desktop/src/renderer/features/bots/BotGroupTimelineItem.tsxindex ed47696840..c5dc57d325 100644--- a/apps/desktop/src/renderer/features/bots/BotGroupTimelineItem.tsx+++ b/apps/desktop/src/renderer/features/bots/BotGroupTimelineItem.tsx@@ -270,8 +270,6 @@ export interface BotGroupTimelineItemProps {/** Finish time of each done step (1-based), read off its hand-off message. */planDoneAt?: ReadonlyMap<number, number>;onPlanAction?: (action: 'start' | 'dismiss', planId: string) => void;- planAutoPending?: boolean;- onPlanAuto?: (planId: string, on: boolean) => void;readOnly?: boolean;onEditStep?: (planId: string, step: BotGroupPlanStepView, action: 'reassign' | 'remove', botId?: string) => void;}@@ -443,8 +441,8 @@ function BotGroupTimelineItemImpl(props: BotGroupTimelineItemProps) {);}- // A server arrangement stands on its own: the turns it lines up, under the request or the- // lead's answer, never folded into someone's reply (bot-group-chat.md §7).+ // A server queue stands on its own under the request: the turns it lines up, never folded+ // into someone's reply (bot-group-chat.md §7).if (message.kind === 'plan' && props.plan?.kind) {return (<Row {...rowProps} block="author">@@ -464,8 +462,6 @@ function BotGroupTimelineItemImpl(props: BotGroupTimelineItemProps) {onStart={() => undefined}onDismiss={() => undefined}onEditStep={(step, action, botId) => { if (message.planId) props.onEditStep?.(message.planId, step, action, botId); }}- autoPending={props.planAutoPending}- onAutoContinue={props.readOnly || !message.planId ? undefined : on => props.onPlanAuto?.(message.planId!, on)}/></div></div>diff --git a/apps/desktop/src/renderer/features/bots/__tests__/BotGroupChatView.test.tsx b/apps/desktop/src/renderer/features/bots/__tests__/BotGroupChatView.test.tsxindex 7aa5353d99..a714dc9039 100644--- a/apps/desktop/src/renderer/features/bots/__tests__/BotGroupChatView.test.tsx+++ b/apps/desktop/src/renderer/features/bots/__tests__/BotGroupChatView.test.tsx@@ -38,7 +38,6 @@ const mocks = vi.hoisted(() => ({continueBotGroupPlan: vi.fn(),retryBotGroupPlan: vi.fn(),editBotGroupPlanStep: vi.fn(),- setBotGroupPlanAuto: vi.fn(),openPath: vi.fn(),pushes: [] as Array<(payload: BotGroupChangedPayload, stamp?: unknown) => void>,toastError: vi.fn(),@@ -295,7 +294,6 @@ beforeEach(() => {mocks.continueBotGroupPlan.mockReset().mockResolvedValue({ ok: true });mocks.retryBotGroupPlan.mockReset().mockResolvedValue({ ok: true });mocks.editBotGroupPlanStep.mockReset().mockResolvedValue({ ok: true });- mocks.setBotGroupPlanAuto.mockReset().mockResolvedValue({ ok: true });mocks.openPath.mockReset().mockResolvedValue({ success: true });mocks.thread.mockReset().mockImplementation(async ({ rootId }: { rootId: string }) => ({ok: true,@@ -335,7 +333,6 @@ beforeEach(() => {continueBotGroupPlan: (...args: unknown[]) => mocks.continueBotGroupPlan(...args),retryBotGroupPlan: (...args: unknown[]) => mocks.retryBotGroupPlan(...args),editBotGroupPlanStep: (...args: unknown[]) => mocks.editBotGroupPlanStep(...args),- setBotGroupPlanAuto: (...args: unknown[]) => mocks.setBotGroupPlanAuto(...args),onBotGroupChanged: (cb: (payload: BotGroupChangedPayload, stamp?: unknown) => void) => {mocks.pushes.push(cb);return () => {@@ -2208,23 +2205,34 @@ describe('BotGroupChatView', () => {expect(remove.textContent).toContain('bots.groupChat.plan.keepOneStep');});- // bot-group-chat.md §7: a server arrangement stands on its own (no organizer authorship),- // waits for 继续 unless its owner turns on auto-continue, and then offers no 继续 row.- it.each([false, true])('shows a server arrangement on its own and lets its owner auto-continue (auto=%s)', async auto => {- const arranged = plan({- status: 'waiting', currentStep: 0, kind: 'talk', autoContinue: auto, canManage: true,- steps: [{ ...plan().steps[0]!, task: '', status: 'done' }, { ...plan().steps[1]!, status: 'pending' }],+ // bot-group-chat.md §7: a server queue stands on its own (no organizer authorship) and folds+ // a long queue to the turns around the current one; a short queue shows every turn.+ it.each([+ ['a short queue', 2, 2, false],+ ['a long queue after its first five turns', 7, 3, true],+ ] as const)('shows %s on its own, folded to the turns that matter', async (_label, count, shown, foldable) => {+ const base = plan().steps;+ // Waiting for 继续: after the first turn of a short queue, or after the five that run by themselves.+ const done = count > 5 ? 5 : 1;+ const queue = plan({+ status: 'waiting', currentStep: done - 1, kind: 'talk', canManage: true,+ steps: Array.from({ length: count }, (_, position) => ({ ...base[position % 2]!, position, task: '',+ status: position < done ? 'done' as const : 'pending' as const })),});- mocks.getBotGroup.mockResolvedValue({ ok: true, group: withPlan(arranged) });+ mocks.getBotGroup.mockResolvedValue({ ok: true, group: withPlan(queue) });renderView();const card = await screen.findByTestId('bot-group-arrangement');expect(card.closest('article')).toBeNull();expect(card.textContent).not.toContain('bots.groupChat.plan.intro');expect(card.textContent).toContain('bots.groupChat.plan.talkTurn');- expect(card.textContent).toContain('bots.groupChat.plan.stepSpoken');- expect(!!screen.queryByTestId('bot-group-plan-follow-up')).toBe(!auto);- fireEvent.click(screen.getByRole('switch', { name: 'bots.groupChat.plan.autoContinue' }));- await waitFor(() => expect(mocks.setBotGroupPlanAuto).toHaveBeenCalledWith({ groupId: 'g1', planId: 'p1', autoContinue: !auto }));+ expect(card.querySelectorAll('li')).toHaveLength(shown);+ expect(screen.getByTestId('bot-group-plan-follow-up')).toBeTruthy();+ const fold = screen.queryByTestId('bot-group-plan-fold');+ expect(!!fold).toBe(foldable);+ if (fold) {+ fireEvent.click(fold);+ expect(card.querySelectorAll('li')).toHaveLength(count);+ }});it('offers the next step after a hand-off and opens its files inside the work directory', async () => {diff --git a/apps/desktop/src/renderer/features/bots/botGroupStore.ts b/apps/desktop/src/renderer/features/bots/botGroupStore.tsindex 55ba4eb943..b7c9cbe8fa 100644--- a/apps/desktop/src/renderer/features/bots/botGroupStore.ts+++ b/apps/desktop/src/renderer/features/bots/botGroupStore.ts@@ -21,7 +21,6 @@ import type {BotGroupMutationResult,BotGroupPlanAction,BotGroupPlanActionInput,- BotGroupPlanAutoInput,BotGroupPlanEditInput,BotGroupSummary,} from '../../../shared/botGroupChat';@@ -213,13 +212,6 @@ export async function runBotGroupPlanAction(return settlePlanMutation(() => call(input));}-/** Switch whether a server arrangement starts its next step by itself. */-export async function setBotGroupPlanAuto(input: BotGroupPlanAutoInput): Promise<BotGroupMutationResult | null> {- const api = botGroupApi();- if (!api || typeof api.setBotGroupPlanAuto !== 'function') return NOT_READY;- return settlePlanMutation(() => api.setBotGroupPlanAuto(input));-}-/** Reassign or remove a step of a proposed plan. */export async function editBotGroupPlanStep(input: BotGroupPlanEditInput): Promise<BotGroupMutationResult | null> {const api = botGroupApi();diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.jsonindex f91e7c3b4f..879d666a32 100644--- a/apps/desktop/src/renderer/i18n/locales/en/common.json+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json@@ -9420,6 +9420,7 @@"placeholderPlanProposed": "To change who does what, just say so…","placeholderPlanWaiting": "Want {{name}} to change something? Just say so…","placeholderPlanRunning": "What you say goes to {{name}}, who’s working on it…",+ "placeholderQueueRunning": "What you say goes to {{name}}, who’s speaking…","tooManyAttachments": "Too many attachments. The limit is {{max}} per message.","attachmentsFailed": "Attachments not sent. Check that the files still exist, or remove them and try again.","folderNotSupported": "Folders can’t be attached. Choose the files inside instead."@@ -9570,8 +9571,9 @@"talkTurn": "Share a view","stepSpeaking": "Speaking","stepSpoken": "Done",- "autoContinue": "Continue automatically",- "autoFailed": "Couldn’t change automatic continue. Try again."+ "allTurns_one": "All {{count}} turns",+ "allTurns_other": "All {{count}} turns",+ "foldTurns": "Show fewer"},"speaking": {"planning": "Splitting the work…"diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.jsonindex 4ea17df790..51daeb498b 100644--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json@@ -9381,6 +9381,7 @@"placeholderPlanProposed": "担当や手順を変えたいときは、そのまま話しかけてください…","placeholderPlanWaiting": "{{name}} に直してほしいことがあれば、そのまま話しかけてください…","placeholderPlanRunning": "送った内容は作業中の {{name}} に届きます…",+ "placeholderQueueRunning": "送った内容は発言中の {{name}} に届きます…","tooManyAttachments": "添付ファイルが多すぎます。1 件のメッセージにつき最大 {{max}} 個です","attachmentsFailed": "添付ファイルを送信できませんでした。ファイルが残っているか確認するか、削除してから再試行してください","folderNotSupported": "フォルダーは添付できません。中のファイルを選んでください"@@ -9531,8 +9532,9 @@"talkTurn": "意見を述べる","stepSpeaking": "発言中","stepSpoken": "発言済み",- "autoContinue": "自動で次へ",- "autoFailed": "自動で次へを切り替えられませんでした。もう一度お試しください"+ "allTurns_one": "全 {{count}} 人",+ "allTurns_other": "全 {{count}} 人",+ "foldTurns": "折りたたむ"},"speaking": {"planning": "役割分担を考えています…"diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.jsonindex d381ceff6f..160d1f1a34 100644--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json@@ -9381,6 +9381,7 @@"placeholderPlanProposed": "담당이나 단계를 바꾸려면 그냥 말해 주세요…","placeholderPlanWaiting": "{{name}} 님에게 고칠 점이 있으면 그냥 말해 주세요…","placeholderPlanRunning": "보내는 말은 작업 중인 {{name}} 님에게 전달됩니다…",+ "placeholderQueueRunning": "보내는 말은 지금 말하고 있는 {{name}} 님에게 전달됩니다…","tooManyAttachments": "첨부 파일이 너무 많습니다. 메시지 하나에 최대 {{max}}개까지 보낼 수 있습니다","attachmentsFailed": "첨부 파일을 보내지 못했습니다. 파일이 아직 있는지 확인하거나, 제거한 후 다시 시도하세요","folderNotSupported": "폴더는 첨부할 수 없습니다. 폴더 안의 파일을 선택하세요"@@ -9531,8 +9532,9 @@"talkTurn": "의견 말하기","stepSpeaking": "말하는 중","stepSpoken": "완료",- "autoContinue": "자동으로 다음 진행",- "autoFailed": "자동 진행을 바꾸지 못했습니다. 다시 시도하세요"+ "allTurns_one": "전체 {{count}}명",+ "allTurns_other": "전체 {{count}}명",+ "foldTurns": "접기"},"speaking": {"planning": "역할을 나누는 중…"diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.jsonindex 2718deb32d..0c44a3ab70 100644--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json@@ -9381,6 +9381,7 @@"placeholderPlanProposed": "想换人或改步骤,直接说…","placeholderPlanWaiting": "想让{{name}}改改,直接说…","placeholderPlanRunning": "说的话会带给正在做的{{name}}…",+ "placeholderQueueRunning": "说的话会带给正在说的{{name}}…","tooManyAttachments": "附件太多了,一条消息最多 {{max}} 个","attachmentsFailed": "附件没能发出去,请检查文件是否还在,或移除后重试","folderNotSupported": "文件夹不能作为附件,请选择其中的文件"@@ -9531,8 +9532,9 @@"talkTurn": "说说看法","stepSpeaking": "正在说","stepSpoken": "说完了",- "autoContinue": "自动接下一位",- "autoFailed": "没能切换自动接下一位,请再试一次"+ "allTurns_one": "共 {{count}} 位",+ "allTurns_other": "共 {{count}} 位",+ "foldTurns": "收起"},"speaking": {"planning": "正在安排…"diff --git a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.jsonindex 0cd0a753e9..f7ca8d551f 100644--- a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json@@ -9381,6 +9381,7 @@"placeholderPlanProposed": "想換人或改步驟,直接說…","placeholderPlanWaiting": "想讓{{name}}改改,直接說…","placeholderPlanRunning": "說的話會帶給正在做的{{name}}…",+ "placeholderQueueRunning": "說的話會帶給正在說的{{name}}…","tooManyAttachments": "附件太多了,一則訊息最多 {{max}} 個","attachmentsFailed": "附件沒能送出,請檢查檔案是否還在,或移除後重試","folderNotSupported": "資料夾不能作為附件,請選擇其中的檔案"@@ -9531,8 +9532,9 @@"talkTurn": "說說看法","stepSpeaking": "正在說","stepSpoken": "說完了",- "autoContinue": "自動接下一位",- "autoFailed": "沒能切換自動接下一位,請再試一次"+ "allTurns_one": "共 {{count}} 位",+ "allTurns_other": "共 {{count}} 位",+ "foldTurns": "收起"},"speaking": {"planning": "正在安排…"diff --git a/apps/desktop/src/renderer/vite-env.d.ts b/apps/desktop/src/renderer/vite-env.d.tsindex 58a8322f9f..d858e265d5 100644--- a/apps/desktop/src/renderer/vite-env.d.ts+++ b/apps/desktop/src/renderer/vite-env.d.ts@@ -5532,9 +5532,6 @@ interface ElectronAPI {editBotGroupPlanStep: (input: import('../shared/botGroupChat').BotGroupPlanEditInput,) => Promise<import('../shared/botGroupChat').BotGroupMutationResult>;- setBotGroupPlanAuto: (- input: import('../shared/botGroupChat').BotGroupPlanAutoInput,- ) => Promise<import('../shared/botGroupChat').BotGroupMutationResult>;onBotGroupChanged: (cb: (payload: import('../shared/botGroupChat').BotGroupChangedPayload,diff --git a/docs/dev-rules/protocol-compatibility.md b/docs/dev-rules/protocol-compatibility.mdindex 15ee301506..4f25fde12e 100644--- a/docs/dev-rules/protocol-compatibility.md+++ b/docs/dev-rules/protocol-compatibility.md@@ -2462,11 +2462,11 @@ Chat Server `/me` 追加 `capabilities.groupSingleSpeaker: 1`,服务端派发`continueDiscussion` 被接受(后者只记录、不续圈),旧的「继续讨论」只叫被 @ 的伙伴或第一位伙伴。新 Desktop 只在看到该能力时:不再发 `deferExecution`、不做发送前的辅助判断、不发 `continueDiscussion`;-队列停着等继续时新消息按新请求发送(不作为补充);安排动作 `auto` 切换自动接续(旧服务器会拒绝,故以能力为前提)。-`chat_plan.kind` / `auto_continue` 是附加字段,旧客户端忽略;新客户端缺字段时按旧分工卡呈现。+队列停着等继续时新消息按新请求发送(不作为补充)。队列前 5 位由服务端自动接续,无需客户端参与。+`chat_plan.kind` 是附加字段,旧客户端忽略;新客户端缺字段时按旧分工卡呈现。停止的范围收窄只在执行端实现(成员只停自己的请求与伙伴,管理员可 `all`),沿用既有 control /-plan action 的服务端权限,IPC `bot-group:stop` 追加可选 `scope`,新增 `bot-group:plan-auto`;-手机经电脑的远程动作不变(停止为本人范围,暂无自动接续开关)。发布顺序:服务端整集群先上,再发客户端。+plan action 的服务端权限,IPC `bot-group:stop` 追加可选 `scope`;+手机经电脑的远程动作不变(停止为本人范围)。发布顺序:服务端整集群先上,再发客户端。### 伙伴群聊引用回复(`cindy.quote` v1)diff --git a/docs/product-rules/bot-group-chat.md b/docs/product-rules/bot-group-chat.mdindex eaf5350364..72fb9054f5 100644--- a/docs/product-rules/bot-group-chat.md+++ b/docs/product-rules/bot-group-chat.md@@ -127,7 +127,7 @@ Chat Server 声明 `capabilities.groupSingleSpeaker: 1` 时,服务器群按下**没有 @ 人时,群里所有能回答的伙伴排成一个队列**(按成员列表顺序)。群里只有一位伙伴能回答时不排队,它直接回答。伙伴的回复不叫醒任何伙伴,也不能替自己往队列里加人。- **排队的形态只有一种:队列卡**(即第 7 节的安排卡)。卡上一步一位伙伴、一次模型调用,宿主按顺序依次派发,- 不另调模型来排顺序。第一位立即开始;之后每位默认等用户点「继续」,用户觉得够了就不点或点「结束」。+ 不另调模型来排顺序。**前 5 位依次自动回答,第 6 位起每位等用户点「继续」**;用户觉得够了就点停止、「结束」或不再继续。轮到的伙伴没什么可补充时回复 `NO_REPLY`,群里不显示,但这一步照样算说完。- 每位伙伴的回复都是独立消息;安排卡单独一条,只表达顺序与进度,不并入谁的回复。- 不再有群设置「没有 @ 人的时候」「发言方式」「负责人」「项目文件夹」,群头像行不再标「负责人」,@@ -276,9 +276,11 @@ Chat Server 声明 `capabilities.groupSingleSpeaker: 1` 时,服务器群按下- 服务器建的卡都是队列(`talk`):每一步写「说说看法」,状态为「正在说 / 说完了」。旧服务器或旧版建的分工卡(`work`)保持原样。- 不再由辅助模型在发送前判断要不要分工,也不再有「+ 安排分工」入口和「开始 / 不用了」。-- **默认每一步做完停下等「继续」**。卡底的「自动接下一位」由发起人、群主或管理员打开,打开后- 做完的一步立即交给下一位,后续每步完成也自动接续;关闭后回到每步停下。别人看不到开关,也不出现- 「下一步 · 继续」。+- **前 5 位自动接续,第 6 位起每位等「继续」**,没有开关。「下一步 · 继续 / 结束」只给发起人、群主或+ 管理员看。+- **卡片自动折叠**:超过 4 位时只露当前这一位前后共 3 行,卡底「共 N 位」展开全部、「收起」折回。+- 排队时群名下写「某某 正在说…」;有人正在说时输入框提示话会带给他,停着等继续时输入框是普通提示,+ 不暗示「让上一位改改」。- 每一步跑在这张卡自己的 Session 里,上下文只有原问题、前面各位的回答、以及这一步期间你补的话,不带主群历史;不准备项目文件夹或 worktree,不收集产物文件。- 队列有伙伴正在答时,发起人或管理员不 @ 人说的话并入这一步;队列停着等继续时,新消息另起队列(4.0)。diff --git a/packages/maker-shared/src/botGroupChat.ts b/packages/maker-shared/src/botGroupChat.tsindex c35af1e215..38d9f49d70 100644--- a/packages/maker-shared/src/botGroupChat.ts+++ b/packages/maker-shared/src/botGroupChat.ts@@ -348,11 +348,9 @@ export interface BotGroupPlanView {/** Absolute work directory once started; git plans run in their own worktree. */workDir: string | null;branch: string | null;- /** Server groups: `talk` lets teammates answer in turn; `work` divides work into steps. */+ /** Server groups: `talk` queues teammates answering in turn (the first five go on by themselves); `work` divides work into steps. */kind?: 'talk' | 'work';- /** Server groups: the next step starts by itself instead of waiting for 继续. */- autoContinue?: boolean;- /** Server groups: the viewer may continue, stop or switch auto-continue (creator, owner or admin). */+ /** Server groups: the viewer may continue or stop it (creator, owner or admin). */canManage?: boolean;createdAt: number;updatedAt: number;@@ -366,6 +364,8 @@ export interface BotGroupOpenPlanSummary {/** Bot of the current step (running, being redone, or last finished / failed). */currentBotName: string | null;currentStepStatus: BotGroupPlanStepStatus | null;+ /** Server groups: a queue of teammates answering in turn (`talk`) or a division of work. */+ kind?: 'talk' | 'work';}export function isBotGroupPlanOpen(status: BotGroupPlanStatus): boolean {@@ -561,10 +561,6 @@ export interface BotGroupPlanActionInput {export type BotGroupPlanAction = 'start' | 'dismiss' | 'continue' | 'retry';-export interface BotGroupPlanAutoInput extends BotGroupPlanActionInput {- autoContinue: boolean;-}-export interface BotGroupPlanEditInput extends BotGroupPlanActionInput {position: number;/** `reassign` needs `botId`; `remove` keeps at least one step. Proposed plans only. */diff --git a/packages/maker-shared/src/botGroupPresentation.ts b/packages/maker-shared/src/botGroupPresentation.tsindex c66cf98153..9fc71be786 100644--- a/packages/maker-shared/src/botGroupPresentation.ts+++ b/packages/maker-shared/src/botGroupPresentation.ts@@ -218,7 +218,7 @@ export function botGroupPlanFollowUp(plan: BotGroupPlanView | null): BotGroupPla/** Composer copy that follows the open plan (placeholder and the 「安排分工」 gate). */export type BotGroupComposerPlanState =| { kind: 'proposed' }- | { kind: 'running'; botName: string }+ | { kind: 'running'; botName: string; talk?: boolean }| { kind: 'waiting'; botName: string; stepDone: boolean };export function botGroupComposerPlanState(plan: BotGroupPlanView | null): BotGroupComposerPlanState | null {@@ -226,7 +226,9 @@ export function botGroupComposerPlanState(plan: BotGroupPlanView | null): BotGroif (plan.status === 'proposed') return { kind: 'proposed' };const current = currentBotGroupPlanStep(plan);const botName = current?.botName.trim() ?? '';- if (plan.status === 'running') return { kind: 'running', botName };+ if (plan.status === 'running') return { kind: 'running', botName, ...(plan.kind === 'talk' ? { talk: true } : {}) };+ // A queue waiting for 继续 takes a new request, not changes to the last answer (bot-group-chat.md §4.0).+ if (plan.status === 'waiting' && plan.kind === 'talk') return null;if (plan.status === 'waiting') return { kind: 'waiting', botName, stepDone: current?.status === 'done' };return null;}