Frontmatter
| title | >- |
| fix | MCP Infrastructure Stability — Stdout Pollution, Crash Recovery, & Triage |
| author | tobiu |
| state | Merged |
| createdAt | Apr 13, 2026, 6:23 PM |
| updatedAt | Apr 13, 2026, 6:35 PM |
| closedAt | Apr 13, 2026, 6:35 PM |
| mergedAt | Apr 13, 2026, 6:35 PM |
| branches | dev ← agent/9977-infrastructure-stability |
| url | https://github.com/neomjs/neo/pull/9978 |
Merged

tobiu
commented on Apr 13, 2026, 6:25 PM
Input from Antigravity (Gemini 3.1 Pro):
✦ # PR Review Summary
Status: Approved
Thanks for putting this together! Great approach to solving the MCP stdio corruption and tool dispatch crashes. Institutionalizing the "Infrastructure Triage Mandate" is a crucial conceptual safety net for the autonomous Swarm.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 100 - Perfectly aligns with the standard MCP architecture by utilizing the centralizedloggerto preventstdoutJSON-RPC transport corruption.[CONTENT_COMPLETENESS]: 90 - Basic JSDoc is present forgetDefaultSessionId(). A@summarytag would be ideal per the 'Anchor & Echo' mandate, but it is acceptable for this hotfix.[EXECUTION_QUALITY]: 100 - Logic is simple, deterministic, and resolves the crash gracefully.[PRODUCTIVITY]: 100 - Fully achieves the goals of the linked ticket in a surgical manner.[IMPACT]: 80 - High operational impact by preventing silent agent failures and ensuring Neural Link commands successfully dispatch to the active session.[COMPLEXITY]: 20 - Very localized, minimal refactoring.[EFFORT_PROFILE]: Quick Win - Extremely High ROI for base system stability with minimal code churn.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #9977
🧠 Graph Ingestion Notes
[TOOLING_GAP]: We must institutionalize that Node.js MCP standardstdiotransports automatically corrupt if anyconsole.logbypasses the protocol boundaries. Centralizedloggerinjection must be enforced for all future MCP services.[RETROSPECTIVE]: Replacing the fallback behavior inAGENTS_STARTUP.mdwith the "Infrastructure Triage Mandate" represents a fundamental maturation stage. Agents will no longer hallucinate forward progress when their core backend constraints fail.
📋 Required Actions
To proceed with merging, please address the following:
- (No mandatory adjustments required)
This PR is definitively approved. You can proceed to merge.
Resolves #9977.
Summary
This PR formalizes critical infrastructure stability patches discovered during a localized breakdown of the Memory Core and Neural Link MCP servers. The standard JSON-RPC
stdiotransport was corrupting due to raw console output, and missing class methods were causing hard crashes during tool dispatch.Architectural Changes
1. The Infrastructure Triage Mandate (
AGENTS_STARTUP.md)Previously, agents were instructed to ignore
healthcheckfailures and proceed on a degraded Golden Path. This has been explicitly reversed. If core ecosystem servers fail, agents are now strictly mandated to immediately pivot into diagnostic and self-healing workflows. Executing roadmap tasks with a sick framework ecosystem is now forbidden.2. Eliminating
stdoutJSON-RPC CorruptionThe MCP standard transport relies on pure JSON over
stdout.Memory Core / SessionService: Replacedconsole.logwithlogger.infoinside the asynchronous Map-Reduce summarization pipeline.Neural Link / RecorderService: Imported the centralizedlogger.mjsand refactored allconsole.errorandconsole.warnstatements to route through the standard logger.3. Neural Link Runtime Crash Recovery
ConnectionService.mjs: Implemented the missinggetDefaultSessionId()method. ThetoolService.mjsdispatch layer implicitly expected this method to exist to support auto-targeting. Its absence caused soft crashes during any Neural Link tool execution wheresessionIdwas omitted.