diff --git a/packages/frontend/core/src/blocksuite/ai/components/ai-chat-chips/utils.ts b/packages/frontend/core/src/blocksuite/ai/components/ai-chat-chips/utils.ts index fd655b314..f525c80bb 100644 --- a/packages/frontend/core/src/blocksuite/ai/components/ai-chat-chips/utils.ts +++ b/packages/frontend/core/src/blocksuite/ai/components/ai-chat-chips/utils.ts @@ -108,7 +108,10 @@ export function omitChip(chips: ChatChip[], chip: ChatChip) { return !isCollectionChip(item) || item.collectionId !== chip.collectionId; } if (isSelectedContextChip(chip)) { - return !isSelectedContextChip(chip); + return !isSelectedContextChip(item) || item.uuid !== chip.uuid; + } + if (isAttachmentChip(chip)) { + return !isAttachmentChip(item) || item.sourceId !== chip.sourceId; } return true; });