Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(bots): retain deferred controls when splitting work history
Chrisf26898fedcdc
diff --git a/apps/desktop/src/renderer/features/bots/__tests__/botConversationPresentation.test.ts b/apps/desktop/src/renderer/features/bots/__tests__/botConversationPresentation.test.tsindex 13d9d3939c..75aeee776f 100644--- a/apps/desktop/src/renderer/features/bots/__tests__/botConversationPresentation.test.ts+++ b/apps/desktop/src/renderer/features/bots/__tests__/botConversationPresentation.test.ts@@ -205,6 +205,25 @@ describe('teammate final-result presentation', () => {expect(group.deferred).toBe(deferred);});+ it('keeps deferred history controls when lifting a reply after one nested work group', () => {+ const deferred = { owner: {}, key: 'range', expanded: false, loading: false, failed: true,+ previewComplete: false, toggle: vi.fn(), retry: vi.fn(), setVisible: vi.fn() };+ const nested: RenderItem = { type: 'work_group', key: 'work-inner', isStreaming: false, children: [tool('t')] };+ const reply = message('delivered', 'assistant', 'Here is the result', { explicitDelivery: true });+ const history: RenderItem = { type: 'work_group', key: 'work-history', isStreaming: false, children: [nested, reply], deferred };+ const result = simplifyBotRenderItems([history], false);+ expect(shape(result)).toBe('work-history[work-inner[tools-t]], msg-delivered');+ const retained = result[0];+ expect(retained.type === 'work_group' && retained.deferred).toBe(deferred);+ expect(result[1]).toBe(reply);+ expect(deferred.setVisible).not.toHaveBeenCalled();+ expect(deferred.retry).not.toHaveBeenCalled();+ expect(history.children).toEqual([nested, reply]);+ // Ordinary complete groups still unwrap the single inner group with its stable key.+ const complete = simplifyBotRenderItems([{ ...history, deferred: undefined }], false);+ expect(complete).toEqual([nested, reply]);+ });+it('shows a running turn as a live work group and a finished turn as the summary with the answer outside', () => {const at = (offset: number) => new Date(Date.parse('2026-10-15T08:00:00Z') + offset).toISOString();const running = [message('u', 'user', 'Fix it', { createdAt: at(0) }),diff --git a/apps/desktop/src/renderer/features/bots/botConversationPresentation.ts b/apps/desktop/src/renderer/features/bots/botConversationPresentation.tsindex 03d53cda67..6e89c38c47 100644--- a/apps/desktop/src/renderer/features/bots/botConversationPresentation.ts+++ b/apps/desktop/src/renderer/features/bots/botConversationPresentation.ts@@ -108,7 +108,8 @@ function liftRepliesFromWorkGroup(? group.startedAtMs + group.durationMs : null;const flush = (nextReply: MessageRenderItem | null) => {if (pending.length === 0) return;- if (pending.length === 1 && pending[0].type === 'work_group') {+ // Deferred history owns loading/retry state on the outer group, even with one inner group.+ if (!group.deferred && pending.length === 1 && pending[0].type === 'work_group') {out.push(pending[0]);} else {const starts = pending.map(renderItemStartMs).filter((ms): ms is number => ms !== null);