From 7d2282c35cf177f8db07af8f9ffb6033f0871930 Mon Sep 17 00:00:00 2001 From: Artem Rootman <4586640+artemrootman@users.noreply.github.com> Date: Sun, 5 Apr 2026 17:45:44 +0000 Subject: [PATCH] fix: keep 50 messages in getTeamData for backward compatibility Returning messages: [] broke the slash command annotation test and any code relying on getTeamData.messages (notifications, dedup). Keep a small batch (50 newest) in getTeamData for compatibility. Full message history is available via getMessagesPage() API. --- src/main/services/team/TeamDataService.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/services/team/TeamDataService.ts b/src/main/services/team/TeamDataService.ts index 7f7953e7..d50390a8 100644 --- a/src/main/services/team/TeamDataService.ts +++ b/src/main/services/team/TeamDataService.ts @@ -723,15 +723,19 @@ export class TeamDataService { this.processHealthTeams.delete(teamName); } - // Messages are now served separately via getMessagesPage() for pagination. - // Sending an empty array here keeps the TeamData shape unchanged while - // eliminating the ~1MB messages payload from every getTeamData refresh. + // Cap messages to keep IPC payloads small. Full history is available + // via the paginated getMessagesPage() API. We still include a small + // batch here for backward compatibility (notifications, dedup, etc.). + const MAX_RETURN_MESSAGES = 50; + const cappedMessages = + messages.length > MAX_RETURN_MESSAGES ? messages.slice(0, MAX_RETURN_MESSAGES) : messages; + return { teamName, config, tasks: tasksWithKanban, members, - messages: [], + messages: cappedMessages, kanbanState, processes, warnings: warnings.length > 0 ? warnings : undefined,