LearnNewsExamplesServices
Frontmatter
id7866
titleBug: Prevent SessionService from summarizing the active session
stateClosed
labels
bugai
assigneestobiu
createdAtNov 22, 2025, 9:54 PM
updatedAtNov 22, 2025, 10:04 PM
githubUrlhttps://github.com/neomjs/neo/issues/7866
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 22, 2025, 10:04 PM

Bug: Prevent SessionService from summarizing the active session

tobiu
tobiu commented on Nov 22, 2025, 9:54 PM

The summarizeSessions method in ai/mcp/server/memory-core/services/SessionService.mjs can inadvertently summarize the currently active session. This can happen in two scenarios:

  1. Drift Detection: The findSessionsToSummarize method detects the current session as having a mismatch between DB memories and the summary (since the summary doesn't exist or is outdated), flagging it for summarization.
  2. Manual Trigger: An agent manually calls the summarize_sessions tool with the current session ID or without arguments (triggering case 1).

Summarizing the active session is premature as the session is still ongoing. This leads to incomplete summaries and potentially multiple summary entries for the same session.

Goal: Add a guard clause in SessionService to explicitly exclude this.currentSessionId from being summarized, both when finding sessions automatically and when a specific sessionId is requested.

Task:

  • Modify SessionService.mjs (around line 291 in summarizeSessions) to filter out this.currentSessionId.