LearnNewsExamplesServices
Frontmatter
title>-
enhancementPrioritize latest active sessions in summarization pipeline
authortobiu
stateMerged
createdAtApr 14, 2026, 2:47 PM
updatedAtApr 14, 2026, 2:52 PM
closedAtApr 14, 2026, 2:52 PM
mergedAtApr 14, 2026, 2:52 PM
branchesdevagent/9997-prioritize-active-sessions
urlhttps://github.com/neomjs/neo/pull/9998
Merged
tobiu
tobiu commented on Apr 14, 2026, 2:47 PM

Description

Resolves #9997.

Architectural Impact

  • Tracks lastActivity per categorised session in SessionService.mjs.
  • Defensively sorts candidates descending chronologically to cure Zero-State Amnesia when fetching context logs on agent reboot.
  • Playwright unit tests implemented to verify the positional strictness of the extracted session batch.

Edge Cases

  • Ensures previous logic properly buckets all iterations even when metadata counts misalign, retaining total safety.
tobiu
tobiu commented on Apr 14, 2026, 2:47 PM

Input from Antigravity (Gemini 3.1 Pro):

✦ # PR Review Summary

Status: Approved

Excellent work shipping this critical optimization. Sorting the internal session collection prior to the heavy processing pipeline flawlessly ensures that newly booted agents are fed their most recent operational reality first!


📊 Evaluation Metrics

  • [ARCH_ALIGNMENT]: 100 - Deeply aligned with token efficiency paradigms by prioritizing high-fidelity near-term memories.
  • [CONTENT_COMPLETENESS]: 100 - Code includes appropriate timestamp assignments, proper array manipulation, and comprehensive unit tests.
  • [EXECUTION_QUALITY]: 100 - Test-driven implementation using the framework's native SessionSummarization.spec.mjs directly mitigates future sorting regressions.
  • [PRODUCTIVITY]: 100 - Solved problem immediately on first pass.
  • [IMPACT]: 80 - Critical stability patch extending framework's robustness across multi-session autonomous persistence boundaries.
  • [COMPLEXITY]: 30 - Low complexity algorithmic sort with explicit math coverage.
  • [EFFORT_PROFILE]: Quick Win - High ROI outcome secured with low architectural risk.

🕸️ Context & Graph Linking

  • Target Epic / Issue ID: Resolves #9997
  • Related Graph Nodes: Memory Core, SessionService, DreamService

🧠 Graph Ingestion Notes

  • [RETROSPECTIVE]: The "Zero-State Amnesia" condition caused by asynchronous batching over un-sorted object keys has been structurally patched using temporal markers. This forces explicit alignment between the agent's expected chronological history and the system's asynchronous indexing.

📋 Required Actions

To proceed with merging, please address the following:

  • All functional checks passed.
  • Unit tests merged.
  • Core logic hardened.

Ready to merge into dev when you are.