Frontmatter
| title | >- |
| author | tobiu |
| state | Merged |
| createdAt | Apr 13, 2026, 1:43 PM |
| updatedAt | Apr 13, 2026, 1:54 PM |
| closedAt | Apr 13, 2026, 1:54 PM |
| mergedAt | Apr 13, 2026, 1:54 PM |
| branches | dev ← agent/9921-n_ctx-exhaustion |
| url | https://github.com/neomjs/neo/pull/9964 |
Merged

tobiu
commented on Apr 13, 2026, 1:45 PM
Input from gemini-exp-1206 (Antigravity):
✦ # PR Review Summary
Status: Approved
Great job knocking this out! Implementing a hard constraint on the prompt envelope is the most robust, defensive way to avoid hitting local model context exhaustion limits while staying lightweight. I've reviewed the diff and it aligns cleanly with the Neo Agent OS architecture.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 100 - Perfect alignment with the Neo Memory Core architecture. It intercepts the prompt aggregation exactly where it needs to without mutating the underlying vector abstractions.[CONTENT_COMPLETENESS]: 90 - The inline comments clearly explain the purpose of the negative length slice as a preventative measure forn_ctx.[EXECUTION_QUALITY]: 100 - Clean execution. The unit test explicitly intercepts the mock's prompt generation to mathematically prove the length falls within safe boundaries, ensuring no slow live-model API calls block the test suite.[PRODUCTIVITY]: 100 - Successfully prevents MLX context crashes, which directly unblocks the RLAIF backend.[IMPACT]: 85 - High impact for system stability. Resolves an immediate infrastructure blocker.[COMPLEXITY]: 20 - Very targeted, focused implementation.[EFFORT_PROFILE]: Quick Win - High ROI/Low Complexity.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #9921
- Related Graph Nodes:
SessionService
🧠 Graph Ingestion Notes
[KB_GAP]: N/A[TOOLING_GAP]: N/A[RETROSPECTIVE]: The decision to truncate strings by prioritizing the tail endslice(-MAX_CONTENT_LENGTH)is a significant strategic takeaway for conversational RLAIF extraction. Because agents resolve their tasks at the very end of a turn sequence, the chronological tail holds the highest summarization value. Always preserve the trailing edges when forced to truncate sequences.
📋 Required Actions
To proceed with merging, please address the following:
- All PR components approved and ready for Squash Merge by the Commander.
Excellent work resolving the
n_ctxconstraints! Once this is merged, we can proceed to #9913.
Resolves #9921. Implements strict text length truncation on Session Service session history aggregation to prevent raw context payload sizes from crashing local MLX OpenAiCompatible endpoints via n_ctx exhaustion limits. Includes Unit Testing coverage as specified by the testing skill guidelines.