Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(bots): show the default organizer by its companion ID
Chris763cfe29551d
diff --git a/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.tsindex 929f71d511..676ebfc068 100644--- a/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts+++ b/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts@@ -1683,7 +1683,7 @@ describe('Chat Server result delivery and refresh', () => {['mention-only mid-turn: unmentioned words stay ordinary messages', 'running', `/conversations/${roomId}/messages`, 'talk', 'mentioned'],['of a 分工 waiting for 继续: a redo for its teammate', 'waiting', `/conversations/${roomId}/plans/80000000-0000-4000-8000-000000000002/messages`, 'work'],['of a 分工 waiting for 继续 in a mention-only group: an ordinary message', 'waiting', `/conversations/${roomId}/messages`, 'work', 'mentioned'],- ] as const)('with an open card %s', async (_label, status, route, kind: string = 'talk', responseMode: string = 'all') => {+ ] as const)('with an open card %s', async (_label, status, route, kind: 'talk' | 'work' = 'talk', responseMode: 'all' | 'mentioned' = 'all') => {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, 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' }] };@@ -1876,6 +1876,8 @@ describe('Chat Server result delivery and refresh', () => {await service.listGroups();const result = await service.getGroup(roomId);expect(result.ok && result.group.members[0]).toMatchObject({ botId: 'local-bot', isOwned: true, homeDeviceId: 'home-pc' });+ // No organizer chosen yet: settings select the first companion, so it must be its local ID.+ expect(result.ok && result.group.organizerBotId).toBe('local-bot');});it('projects hidden paused local companions with their real local identity and never claims work for them', async () => {fixture.profiles = [{ id: 'local-bot', displayName: 'Bot', status: 'paused', hiddenAt: 1 }];diff --git a/apps/desktop/src/main/maker-ipc/chatServer.ts b/apps/desktop/src/main/maker-ipc/chatServer.tsindex 2809cf7850..23649a9c11 100644--- a/apps/desktop/src/main/maker-ipc/chatServer.ts+++ b/apps/desktop/src/main/maker-ipc/chatServer.ts@@ -1326,7 +1326,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: 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 ? {+ }), 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 ? {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,@@ -1435,7 +1435,9 @@ function createChatServer(local: BotGroupChatService, deps: BotGroupChatServiceD/** The user wrote the card, so it starts at once; each step still stops for 继续 (§7.4). */async function openWrittenPlan(s: Snapshot, sourceId: string, request: string, steps: PlanStepDraft[], intent: PlanIntent) {if (!current() || planIntents.get(s.room.id) !== intent) return;- const organizerId = steps.some(step => step.botId === s.room.organizer_id) ? s.room.organizer_id! : steps[0]!.botId;+ // The organizer settings show: the chosen one, else the first companion.+ const shown = s.room.organizer_id ?? s.members.find(m => m.kind === 'bot' && m.state === 'joined')?.id;+ const organizerId = steps.some(step => step.botId === shown) ? shown! : steps[0]!.botId;let plan: ServerPlan;try {plan = await api<ServerPlan>(`/conversations/${s.room.id}/plans`, 'POST', {