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.
This commit is contained in:
Artem Rootman 2026-04-05 17:45:44 +00:00
parent 0c0e0240a3
commit 7d2282c35c
No known key found for this signature in database
GPG key ID: B7C30676209A822C

View file

@ -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,