Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(chat): release a 分工 nobody can arrange; mention-only words leave proposed cards alone
Chrisbb8be824efad
diff --git a/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.tsindex b3657874db..7181cb0358 100644--- a/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts+++ b/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts@@ -1766,6 +1766,34 @@ describe('Chat Server result delivery and refresh', () => {expect(posts().some(([route]) => route === `/conversations/${roomId}/plans/${planId}`)).toBe(false);});+ it('answers the request when nobody can arrange it, and later messages still go out', async () => {+ divisionServer();+ deps.decidePlan = undefined;+ await send('Make a draft');+ expect(posts().some(([route]) => route === `/conversations/${roomId}/messages/${sourceId}/continue`)).toBe(true);+ expect(await service.sendMessage({ groupId: roomId, text: 'Another thing', clientId: 'after-no-organizer', mentions: { all: false, botIds: [] } }))+ .toMatchObject({ ok: true });+ });++ // §4.0: in a mention-only group an unaddressed message wakes nobody, not even the helper revising your proposed card.+ it.each([['all', true], ['mentioned', false]] as const)('in %s mode, unaddressed words revise your proposed card: %s', async (mode, revises) => {+ const proposed = { id: planId, revision: 1, source_message_id: execution.source_message_id, request_text: 'Q', organizer_id: botId, creator_id: selfId,+ note_message_ids: [], status: 'proposed', current_step: null, kind: 'work', created_at: '2026-10-03T00:00:00Z', updated_at: '2026-10-03T00:00:00Z',+ steps: [{ position: 0, botId, botName: 'Bot', task: 'draft', status: 'pending' }] };+ singleSpeaker((route, method) => {+ if (route.endsWith('/snapshot')) return { body: { room: { ...room(roomId), response_mode: mode }, members: named(), messages: [], cursor: '1' } };+ if (route === `/conversations/${roomId}/messages` && method === 'POST') return { body: { id: sourceId } };+ if (route === `/conversations/${roomId}/plans`) return { body: [proposed] };+ return undefined;+ });+ deps.decidePlan = vi.fn(async () => null);+ expect(await service.sendMessage({ groupId: roomId, text: 'Make it shorter', clientId: `revise-${mode}`, mentions: { all: false, botIds: [] } }))+ .toMatchObject({ ok: true });+ await vi.advanceTimersByTimeAsync(0);+ expect(posts().find(([route]) => route === `/conversations/${roomId}/messages`)![2]).toMatchObject({ deferExecution: revises });+ expect(vi.mocked(deps.decidePlan!).mock.calls.length > 0).toBe(revises);+ });+// The server cannot release a held request, so a newer message must not replace one still being arranged.it('refuses a newer message while the organizer is arranging', async () => {divisionServer();diff --git a/apps/desktop/src/main/maker-ipc/chatServer.ts b/apps/desktop/src/main/maker-ipc/chatServer.tsindex 271f01188b..bc22e9c12b 100644--- a/apps/desktop/src/main/maker-ipc/chatServer.ts+++ b/apps/desktop/src/main/maker-ipc/chatServer.ts@@ -1429,7 +1429,12 @@ function createChatServer(local: BotGroupChatService, deps: BotGroupChatServiceDif (!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'));const organizer = members.find(m => m.id === s.room.organizer_id) ?? members[0];- if (!organizer || !deps.decidePlan) throw new Error('MEMBER_UNAVAILABLE');+ if (!organizer || !deps.decidePlan) {+ // Nobody can arrange it: release the request now, or every later send would wait for a card that never comes.+ delete intent.sourceId;+ if (forced) await settleExplicitRequest(s.room.id, sourceId, true);+ throw new Error('MEMBER_UNAVAILABLE');+ }planning.get(s.room.id)?.controller.abort();const controller = new AbortController();const pending = { botId: localBot(organizer.id)?.id ?? organizer.id, controller };@@ -2544,7 +2549,7 @@ function createChatServer(local: BotGroupChatService, deps: BotGroupChatServiceD// Single-speaker servers queue turns themselves; only a 分工, or words about your proposed card,// wait for the arrangement. A 分工 that writes out its steps needs no helper model.const shouldPlan = singleSpeaker- ? i.division || (proposed && namesNobody(i.mentions) && !!deps.decidePlan)+ ? i.division || (canTrigger && proposed && namesNobody(i.mentions) && !!deps.decidePlan): canTrigger && !!deps.decidePlan && (i.division || (!i.mentions.botIds.length && (!proposed || !i.mentions.all)))&& (!openPlan || proposed);const prepared = i.attachments?.length ? await deps.prepareAttachments?.({ groupId: i.groupId, attachments: i.attachments, controllerDeviceId: origin?.controllerDeviceId }) : undefined;diff --git a/docs/product-rules/bot-group-chat.md b/docs/product-rules/bot-group-chat.mdindex fd131c8953..6cb4c005f7 100644--- a/docs/product-rules/bot-group-chat.md+++ b/docs/product-rules/bot-group-chat.md@@ -310,7 +310,7 @@ Chat Server 声明 `capabilities.groupSingleSpeaker: 1` 时,服务器群按下文字里认不出(发出前改了名)时,不当作写好的步骤。解析在 `@cindy/maker-shared/botGroupMentions` 的 `splitBotGroupRelaySteps`。- **没写成步骤就交给负责人**出安排卡(「开始 / 不用了」),沿用 7.2 手动分工的流程与每候选 20 秒的预算;开始前- 不 @ 人说话仍是修改意见(7.3)。安排不出来、或负责人认为不用分工时,这条请求立即按 4.0 回答(点名的依次答,+ 不 @ 人说话仍是修改意见(7.3;回复模式为「只有被 @ 的回答」时不算,照 4.0 不叫任何人)。安排不出来、或负责人认为不用分工时,这条请求立即按 4.0 回答(点名的依次答,否则第一位伙伴答),不让它干等服务端两分钟后再排队。- 发出前宿主让消息先挂起,服务端不会先拿它去排讨论队列;建卡后挂起解除。你自己的讨论队列停着等「继续」时,先把它结束再建分工卡;还有别人的卡或正在进行的卡时拒绝(`PLAN_OPEN`),与旧版一致。