LearnNewsExamplesServices
Frontmatter
title>-
authortobiu
stateMerged
createdAtApr 13, 2026, 1:57 PM
updatedAtApr 13, 2026, 1:59 PM
closedAtApr 13, 2026, 1:59 PM
mergedAtApr 13, 2026, 1:59 PM
branchesdevagent/9965-map-reduce-session
urlhttps://github.com/neomjs/neo/pull/9966
Merged
tobiu
tobiu commented on Apr 13, 2026, 1:57 PM

Resolves #9965. Refactors SessionService into a lossless Map-Reduce chunking pipeline. Drops the aggressive historical truncation block installed in #9921, securing massive RLAIF extraction loops by preserving their full contextual path. Features complete Playwright unit test mapping emulation.

tobiu
tobiu commented on Apr 13, 2026, 1:58 PM

Input from gemini-exp-1206 (Antigravity):

✦ # PR Review Summary

Status: Approved

Awesome refactoring! This guarantees we no longer blindly chop off episodic memory when saving large tasks. Offloading the context parsing to a Map-Reduce loop directly within SessionService secures the long-term reliability of our internal RLAIF structure.


📊 Evaluation Metrics

  • [ARCH_ALIGNMENT]: 100 - Solved a complex token limit issue perfectly within the existing abstractions (the internal this.model.generateContent API layer).
  • [CONTENT_COMPLETENESS]: 95 - The implementation handles the sequential splitting gracefully and adds important console traces for when Map-Reduce fires.
  • [EXECUTION_QUALITY]: 100 - Playwright tests specifically model the Map-Reduce loop to prevent regressions, isolating mock detection logic elegantly.
  • [PRODUCTIVITY]: 100 - Resolved P0 Ticket #9965.
  • [IMPACT]: 90 - Protects against systemic data loss and solidifies the robustness of graph extraction.
  • [COMPLEXITY]: 50 - Required an asynchronous map stage and array orchestration within an already complex string parsing method.
  • [EFFORT_PROFILE]: Heavy Lift - Resolves a structurally compromising issue dynamically.

🕸️ Context & Graph Linking

  • Target Epic / Issue ID: Resolves #9965
  • Related Graph Nodes: SessionService

🧠 Graph Ingestion Notes

  • [KB_GAP]: N/A
  • [TOOLING_GAP]: N/A
  • [RETROSPECTIVE]: Token exhaustion is best mitigated actively inside the infrastructure layer through lossless chunking (Map-Reduce) instead of aggressive historical truncation. This preserves the internal chronological sequence of an agent's hypotheses and actions seamlessly across local API endpoints.

📋 Required Actions

To proceed with merging, please address the following:

  • Merge PR #9966 to dev using Squash Merge.

Looks ready to go!