fix(server): skip empty docs (#12396)

fix AI-129
fix CLOUD-129
This commit is contained in:
darkskygit
2025-05-20 10:52:00 +00:00
parent 20665575d0
commit afbda482de

View File

@@ -224,7 +224,8 @@ export class CopilotContextDocJob {
try {
const content = await this.doc.getFullDocContent(workspaceId, docId);
if (content) {
// no need to check if embeddings is empty, will throw internally
// fast fall for empty doc, journal is easily to create a empty doc
if (!content.summary) return;
const embeddings = await this.embeddingClient.getFileEmbeddings(
new File([content.summary], `${content.title || 'Untitled'}.md`)
);