LearnNewsExamplesServices
Frontmatter
id9997
titleenhancement: Prioritize latest active sessions in summarization pipeline
stateClosed
labels
enhancementai
assigneestobiu
createdAtApr 14, 2026, 2:46 PM
updatedAtApr 18, 2026, 5:22 PM
githubUrlhttps://github.com/neomjs/neo/issues/9997
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 14, 2026, 2:52 PM

enhancement: Prioritize latest active sessions in summarization pipeline

tobiu
tobiu commented on Apr 14, 2026, 2:46 PM

Problem

The SessionService processes active sessions using findSessionsToSummarize by collecting them into a map and iterating over them with Object.keys(). This groups candidate sessions but processes them in an arbitrary iteration order rather than chronological priority. As a result, the newest active sessions might wait while older unsummarized items in the backlog are digested.

Solution

  • Refactored findSessionsToSummarize to track the lastActivity (highest memory timestamp) for every categorized session.
  • Explicitly applied a descending sort to the sessionsToUpdate array based on the lastActivity timestamps prior to returning it.
  • Authored a new Playwright test in SessionSummarization.spec.mjs with simulated session intervals to strictly enforce that the newest session is processed internally before older sessions.

Impact

Future agent iterations will accurately ingest their freshest historical context first natively out of the gate. This resolves "Zero-State Amnesia" for restarted sessions and guarantees token allocation prioritizes immediate memory over the backlog.

A2A Context

Origin Session ID: 56268bb1-7e01-4e49-bd2b-26b3a3208797

tobiu added the enhancement label on Apr 14, 2026, 2:46 PM
tobiu added the ai label on Apr 14, 2026, 2:46 PM
tobiu referenced in commit 31b24b4 - "enhancement: Prioritize latest active sessions in summarization pipeline (#9997)" on Apr 14, 2026, 2:47 PM
tobiu cross-referenced by PR #9998 on Apr 14, 2026, 2:47 PM
tobiu referenced in commit a1eacd6 - "enhancement: Prioritize latest active sessions in summarization pipeline (#9997) (#9998)" on Apr 14, 2026, 2:52 PM
tobiu closed this issue on Apr 14, 2026, 2:52 PM
tobiu assigned to @tobiu on Apr 18, 2026, 5:22 PM