Context
During the diagnosis of the Memory Core boot failure (Ticket #10305), we discovered a "YAML Cascade" failure mode. A syntax error in github-workflow/openapi.yaml caused a js-yaml exception. Because ai/services.mjs eagerly loads all MCP server definitions synchronously on boot, this single failure cascaded and prevented all connected MCP servers (including Memory Core and Knowledge Base) from initializing.
The Problem
The ToolService initialized within ai/services.mjs synchronously parses all .yaml files across all servers. The current architecture treats MCP server initialization as an all-or-nothing operation, granting every individual specification the blast radius to take down the entire Agent OS infrastructure.
The Architectural Reality
ai/services.mjs acts as a monolithic aggregator. When it iterates through configured tools, a single YAMLException thrown by js-yaml aborts the entire module's execution. This tight coupling blocks the Node process and binds the lifecycles of fundamentally independent subsystems together.
The Fix
- Refactor the YAML parsing and server initialization inside
ToolService and ai/services.mjs to implement an isolation boundary.
- Catch parser exceptions on a per-server basis. Log the error and gracefully skip the failed server configuration rather than crashing the aggregator.
- Ensure the remaining healthy MCP servers are successfully loaded and exposed to the swarm.
Acceptance Criteria
Out of Scope
Migrating existing MCP servers to a new communication protocol or restructuring the directory layouts; this is purely an isolation and resilience refactor of the existing aggregator.
Related
Origin Session ID: 0b29a8fa-c6b0-42e2-ab3b-8015a99db2d8
Retrieval Hint: "YAML Cascade eager aggregator refactor ai/services.mjs"
Context
During the diagnosis of the Memory Core boot failure (Ticket #10305), we discovered a "YAML Cascade" failure mode. A syntax error in
github-workflow/openapi.yamlcaused ajs-yamlexception. Becauseai/services.mjseagerly loads all MCP server definitions synchronously on boot, this single failure cascaded and prevented all connected MCP servers (including Memory Core and Knowledge Base) from initializing.The Problem
The
ToolServiceinitialized withinai/services.mjssynchronously parses all.yamlfiles across all servers. The current architecture treats MCP server initialization as an all-or-nothing operation, granting every individual specification the blast radius to take down the entire Agent OS infrastructure.The Architectural Reality
ai/services.mjsacts as a monolithic aggregator. When it iterates through configured tools, a singleYAMLExceptionthrown byjs-yamlaborts the entire module's execution. This tight coupling blocks the Node process and binds the lifecycles of fundamentally independent subsystems together.The Fix
ToolServiceandai/services.mjsto implement an isolation boundary.Acceptance Criteria
openapi.yamlfile (e.g.,github-workflow) does NOT prevent other MCP servers (e.g.,memory-core) from booting.McpServersHealth.spec.mjsgracefully isolates the failure (failing only the broken server's checks) instead of cascading into a full suite crash.Out of Scope
Migrating existing MCP servers to a new communication protocol or restructuring the directory layouts; this is purely an isolation and resilience refactor of the existing aggregator.
Related
Origin Session ID: 0b29a8fa-c6b0-42e2-ab3b-8015a99db2d8 Retrieval Hint: "YAML Cascade eager aggregator refactor ai/services.mjs"