diff --git a/packages/backend/server/src/plugins/copilot/context/job.ts b/packages/backend/server/src/plugins/copilot/context/job.ts index 270f2cf8a2..4e0d4ba4a4 100644 --- a/packages/backend/server/src/plugins/copilot/context/job.ts +++ b/packages/backend/server/src/plugins/copilot/context/job.ts @@ -261,7 +261,7 @@ export class CopilotContextDocJob { ): Promise { const docContent = await this.doc.getFullDocContent(workspaceId, docId); const authors = await this.models.doc.getAuthors(workspaceId, docId); - if (docContent?.summary && authors) { + if (docContent && authors) { const { title = 'Untitled', summary } = docContent; const { createdAt, updatedAt, createdByUser, updatedByUser } = authors; return { diff --git a/tests/affine-cloud-copilot/e2e/basic/chat.spec.ts b/tests/affine-cloud-copilot/e2e/basic/chat.spec.ts index b33214e951..5922034155 100644 --- a/tests/affine-cloud-copilot/e2e/basic/chat.spec.ts +++ b/tests/affine-cloud-copilot/e2e/basic/chat.spec.ts @@ -28,7 +28,9 @@ test.describe('AIBasic/Chat', () => { await check.hover(); const tooltip = await page.getByTestId('ai-chat-embedding-status-tooltip'); await expect(tooltip).toBeVisible(); - await expect(tooltip).toHaveText(/Results will improve after embedding/i); + await expect(tooltip).toHaveText( + /Results will improve after embedding|Embedding finished/ + ); }); test(`should send message and receive AI response: