From be646308197f1dc7d065afa7517fcab7a2e6ae25 Mon Sep 17 00:00:00 2001 From: Manoj Date: Thu, 4 Sep 2025 10:19:35 +0530 Subject: [PATCH] Fix: incremental space summary --- apps/webapp/app/trigger/spaces/space-summary.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/webapp/app/trigger/spaces/space-summary.ts b/apps/webapp/app/trigger/spaces/space-summary.ts index 18c48f8..bdafa2d 100644 --- a/apps/webapp/app/trigger/spaces/space-summary.ts +++ b/apps/webapp/app/trigger/spaces/space-summary.ts @@ -292,7 +292,7 @@ async function generateSpaceSummary( spaceId: space.uuid, spaceName: space.name, spaceDescription: space.description as string, - statementCount: statements.length, + statementCount: existingSummary?.statementCount ? existingSummary?.statementCount + statements.length : statements.length, summary: summaryResult.summary, keyEntities: summaryResult.keyEntities || [], themes: summaryResult.themes, @@ -485,6 +485,7 @@ async function getExistingSummary(spaceId: string): Promise<{ summary: string; themes: string[]; lastUpdated: Date; + statementCount: number; } | null> { try { const existingSummary = await getSpace(spaceId); @@ -493,7 +494,8 @@ async function getExistingSummary(spaceId: string): Promise<{ return { summary: existingSummary.summary, themes: existingSummary.themes, - lastUpdated: existingSummary.updatedAt, + lastUpdated: existingSummary.lastPatternTrigger, + statementCount: existingSummary.statementCount, }; }