Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(bots): 失去群订阅后不复用旧的话题缓存
Dash200f3667bc0c
diff --git a/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.tsindex e047cf6ce9..6d406130b1 100644--- a/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts+++ b/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts@@ -1293,6 +1293,31 @@ describe('Chat Server result delivery and refresh', () => {expect(reads()).toBe(3);});+ it('does not reuse a cached share source after losing the room subscription', async () => {+ const outside = '70000000-0000-4000-8000-00000000000a';+ const share = msg('90000000-0000-4000-8000-00000000000a', 9, aliceId, { content: shareCard(outside) });+ let visible = true;+ fixture.handle.mockImplementation((route, method, body) => {+ if (route.endsWith('/snapshot')) return { body: { room: room(roomId), members, messages: [share], cursor: '9' } };+ if (route.startsWith(`/conversations/${roomId}/messages?limit=`)) return { body: [share] };+ if (route.endsWith(`/messages/${outside}`)) return visible+ ? { body: msg(outside, 1, aliceId, { threadRootId: rootId, content: [{ type: 'text', text: 'before you left' }] }) }+ : { status: 404, body: { error: { code: 'MESSAGE_NOT_FOUND' } } };+ return threadResponse(route, method, body);+ });+ const shareView = async () => {+ const result = await service.getGroup(roomId);+ if (!result.ok) throw new Error('Expected group');+ return result.group.messages.find(m => m.id === share.id)!.threadShare!;+ };+ expect(await shareView()).toMatchObject({ status: 'available', content: 'before you left' });+ await vi.advanceTimersByTimeAsync(2000);+ // Removed from the room; on rejoin the history window no longer covers that reply.+ fixture.sockets.at(-1)!.emit('message', JSON.stringify({ type: 'scope_error', scope: `conversation:${roomId}`, error: { code: 'FORBIDDEN' } }));+ visible = false;+ expect(await shareView()).toMatchObject({ status: 'unavailable', content: '' });+ });+it('does not let 「继续讨论」 restart a re-posted reply', async () => {const ask = msg('90000000-0000-4000-8000-0000000000aa', 1, selfId);fixture.handle.mockImplementation((route, method, body) => {diff --git a/apps/desktop/src/main/maker-ipc/chatServer.ts b/apps/desktop/src/main/maker-ipc/chatServer.tsindex 33514d40d5..5b707fa40c 100644--- a/apps/desktop/src/main/maker-ipc/chatServer.ts+++ b/apps/desktop/src/main/maker-ipc/chatServer.ts@@ -471,6 +471,8 @@ function createChatServer(local: BotGroupChatService, deps: BotGroupChatServiceD}).catch(() => ws.close());} else {rooms.delete(roomId);+ // Access may come back with a narrower history; re-read every reference.+ threads.reset();changed(roomId);}}