Frontmatter
| id | 9921 |
| title | fix(ai): Resolve local inference 4096 n_ctx Exhaustion During Session Summarization |
| state | Closed |
| labels | bugai |
| assignees | tobiu |
| createdAt | Apr 12, 2026, 3:25 PM |
| updatedAt | Apr 14, 2026, 12:32 AM |
| githubUrl | https://github.com/neomjs/neo/issues/9921 |
| author | tobiu |
| commentsCount | 0 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [ ] 9954 Epic: The Self-Healing Protocol |
| closedAt | Apr 13, 2026, 1:54 PM |
fix(ai): Resolve local inference 4096 n_ctx Exhaustion During Session Summarization
tobiu marked this issue as blocking #9954 on Apr 13, 2026, 1:13 PM
tobiu cross-referenced by PR #9964 on Apr 13, 2026, 1:43 PM
tobiu cross-referenced by #9965 on Apr 13, 2026, 1:53 PM
tobiu closed this issue on Apr 13, 2026, 1:54 PM
tobiu cross-referenced by PR #9966 on Apr 13, 2026, 1:58 PM
tobiu assigned to @tobiu on Apr 14, 2026, 12:32 AM
Description
The
mcp_neo-mjs-memory-core_summarize_sessionstool routinely crashes internally with the local inference daemon error:The number of tokens to keep from the initial prompt is greater than the context length (n_keep: 5382 >= n_ctx: 4096).This indicates that as
Neo.ai.Agentreasoning loops expand during heavily contextual RLAIF sessions (due to increased swarm intelligence and tool use), the final session summarization pipeline strictly drops the payload and fails to index the session.Architectural Rationale
openAiCompatible) currently defaults to a context limit of 4096 tokens when hostinggemma4:31bor similar local models.n_ctxlimit at the deployment daemon layer (e.g., updating Python boot args to8192), or we must instruct thememory-coreMCP Server to truncate/chunk the combinedprompt + thought + responsestrings before throwing the batch at the extraction endpoint.Origin Session ID: 95bf4a2b-d84e-4f70-945b-f558ba924d3a