LearnNewsExamplesServices
Frontmatter
id11103
titlegithub-workflow MCP boot fails: toolService.mjs has stale 3-dot relative import (post-#10997 M6 migration)
stateClosed
labels
bugaimodel-experience
assigneesneo-opus-4-7
createdAtMay 10, 2026, 2:44 PM
updatedAtMay 10, 2026, 2:57 PM
githubUrlhttps://github.com/neomjs/neo/issues/11103
authorneo-opus-4-7
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 10, 2026, 2:57 PM

github-workflow MCP boot fails: toolService.mjs has stale 3-dot relative import (post-#10997 M6 migration)

Closedbugaimodel-experience
neo-opus-4-7
neo-opus-4-7 commented on May 10, 2026, 2:44 PM

Context

After M6 migration PR #10997 (commit dc437318e, merged 2026-05-08), ai/services/github-workflow/toolService.mjs:11 retains a stale 3-dot relative-import path that resolves to repo-root, causing the github-workflow MCP server to crash on boot:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/Shared/github/neomjs/neo/ToolService.mjs' imported from /Users/Shared/github/neomjs/neo/ai/services/github-workflow/toolService.mjs

Root cause

Empirically verified via discipline-symmetric-application audit across all 4 SDK toolService.mjs files:

File Import path Correct?
memory-core/toolService.mjs '../../mcp/ToolService.mjs'
knowledge-base/toolService.mjs '../../mcp/ToolService.mjs'
neural-link/toolService.mjs '../../mcp/ToolService.mjs'
github-workflow/toolService.mjs '../../../ToolService.mjs'

PR #10997 moved the file from ai/mcp/server/github-workflow/services/toolService.mjs (3 levels deep) to ai/services/github-workflow/toolService.mjs (2 levels deep) but didn't update the relative-import depth from '../../../ToolService.mjs' to '../../mcp/ToolService.mjs'. The 3-dot path was correct from the OLD location (resolved to ai/mcp/ToolService.mjs); from the NEW location it resolves to repo root where no ToolService.mjs exists.

The Fix

One-line edit in ai/services/github-workflow/toolService.mjs:11:

-import ToolService        from '../../../ToolService.mjs';
+import ToolService        from '../../mcp/ToolService.mjs';

Boot-test verified: with the fix applied, node ai/mcp/server/github-workflow/mcp-server.mjs boots cleanly (background process stays alive past 3s probe; previous run crashed instantly with ERR_MODULE_NOT_FOUND).

Why CI didn't catch this

The 39 unit tests cited in PR #10997's body imported individual service files (IssueService, PullRequestService, etc.) — not the wiring-layer toolService.mjs that aggregates them for the MCP server entry point. Wiring bugs at module-resolution time are invisible to per-service unit tests.

Substrate-quality lesson worth keeping: wiring/aggregation files need their own boot smoke test (e.g., node ai/mcp/server/<server>/mcp-server.mjs with a 3-second-alive probe). Sibling pattern to feedback_symmetric_spec_cleanup and the discipline-symmetric-application heuristic from M4 Epic #11077 cycle 1→3.

Empirical Anchor: Self-Repair Skill Application

Surfaced today (2026-05-10) via the /self-repair skill's Phase 1 step 4 ("Native Terminal Execution: If an MCP connection fails... Boot the Neo MCP servers directly in a separate terminal process using the run_command tool to witness the crash or monitor logs."). Skill-prescribed diagnostic surfaced the bug in <30 seconds.

Operator @tobiu detected the github-workflow tools missing post-harness-restart; suggested /self-repair. Self-repair Phase 1 step 4 → empirical boot-test → grep on sister files → asymmetry surfaced → root cause identified.

Acceptance Criteria

  • ai/services/github-workflow/toolService.mjs:11 patched per the diff above
  • Boot smoke test: node ai/mcp/server/github-workflow/mcp-server.mjs survives 3s probe (no instant ERR_MODULE_NOT_FOUND crash)
  • Audit: confirm no other broken imports remain in ai/services/github-workflow/ post-fix (initial sweep showed all other 3-dot imports correctly resolve to repo-root via src/core/Base.mjs)
  • Optional follow-up: add boot smoke test to CI to prevent future wiring-bug regressions (separate ticket if scope grows)

Out of Scope

  • Audit of other M6-migration PRs (memory-core, knowledge-base, neural-link) for similar wiring bugs — initial empirical sweep showed sister files are correct, but a fresh systematic boot-test per server is worth a separate ticket
  • Refactoring the toolService.mjs aggregator pattern itself

Avoided Traps / Gold Standards Rejected

Decision Matrix

  1. Single-line relative-import fix (Selected): Mirrors the correct pattern in 3 sister files. Lowest-risk, lowest-blast-radius fix.
  2. Migrate ToolService.mjs to a new flatter path: Rejected. Out of scope; would require updating 4 sister imports + sometimes-non-trivial dependents. The current shape is fine; only github-workflow's import was stale.
  3. Switch to bare-name import via package.json subpath imports: Rejected. Substrate-correct pattern is relative imports for internal modules; bare-name imports would require additional package.json plumbing without proportional benefit.
  • Trap: Treating CI-passing as boot-correctness. Rejection: Per-service unit tests don't exercise the wiring-layer entry point that loads at MCP server boot.
  • Trap: Only fixing the symptom without identifying the substrate-quality lesson. Rejection: Boot smoke tests for wiring files would have caught this at PR-review time. Should be added to test substrate (separate follow-up).

Related

  • M6 migration PR #10997 (origin of bug)
  • M6 epic #10993 (parent epic)
  • feedback_symmetric_spec_cleanup MEMORY.md entry (sibling pattern: symmetric audit at code-review time)
  • Discipline-symmetric-application heuristic (#11077 cycle 1→3 retrospective)
  • Self-repair skill Phase 1 step 4 (the diagnostic that surfaced this)

Origin Session ID: c2912891-b459-4a03-b2af-154d5e264df1 Retrieval Hint: "github-workflow MCP boot ERR_MODULE_NOT_FOUND", "toolService.mjs stale relative import", "M6 migration #10997 wiring-bug"

tobiu referenced in commit d2db7f9 - "fix(github-workflow): correct stale ToolService import path post-M6 migration (#11103) (#11104) on May 10, 2026, 2:57 PM
tobiu closed this issue on May 10, 2026, 2:57 PM