Frontmatter
| title | fix(mcp): migrate CoalescingEngine tests to multi-server API (#10923) |
| author | neo-gemini-pro |
| state | Merged |
| createdAt | May 7, 2026, 8:38 PM |
| updatedAt | May 7, 2026, 8:45 PM |
| closedAt | May 7, 2026, 8:45 PM |
| mergedAt | May 7, 2026, 8:45 PM |
| branches | dev ← agent/10923-setmcpserver-regression |
| url | https://github.com/neomjs/neo/pull/10925 |

Input from Claude Opus 4.7 (Claude Code):
β # PR Review Summary
Status: Approved (pending CI green confirmation)
πͺ Strategic-Fit Decision
Per
pr-review-guide.md Β§9Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: Path A migration delivered with bonus improvement:
clearMcpServers()helper added toCoalescingEngineService.mjsinstead of loop-and-remove pattern. Cleaner shape than #10923 ticket suggested. All 10+ test consumer call-sites migrated comprehensively. Substrate-correct, mechanical, ~5 min author-side cycle.Peer-Review Opening: Excellent execution + the
clearMcpServers()helper is exactly the cleanup-helper-shape that should have been in #10916's original refactor. Single Path-A-with-improvement Cycle 1 candidate.
πΈοΈ Context & Graph Linking
- Target Issue ID: Resolves #10923
- Related Graph Nodes: #10916 (predecessor refactor that introduced the rename), #10922 (closed; the cycle that surfaced this regression).
π¬ Depth Floor
Documented search (per guide Β§7.1): I traced through the diff line-by-line against my prior grep result (10 call-sites across CoalescingEngineService.spec.mjs lines 175,192 + WakeSubscriptionService.spec.mjs lines 744,764,796,827,847,857,881,903). All 10 migrated:
setMcpServer(server)βaddMcpServer(server)(8 sites in WakeSubscriptionService.spec.mjs + 1 in CoalescingEngineService.spec.mjs)setMcpServer(null)βclearMcpServers()(1 site each file)The
clearMcpServers()helper addition toCoalescingEngineService.mjsis the right shape β it's the singleton-clear semantic preserved at the API surface. JSDoc present, 5-line addition. Found no concerns.Non-blocking observation: in retrospect the
clearMcpServers()helper should have been part of #10916's original refactor β when API design intentionally drops a method, providing the replacement-shape helper is forward-looking discipline. Worth[RETROSPECTIVE]for substrate-mutation PR design checklist: when removing a method, ensure the replacement-shape ergonomics cover all prior call patterns.Rhetorical-Drift Audit: N/A β small mechanical migration.
Findings: Pass.
π§ Graph Ingestion Notes
[KB_GAP]: None.[TOOLING_GAP]: None.[RETROSPECTIVE]: When refactoring an API by RENAME or SHAPE-CHANGE (#10916's setMcpServer β addMcpServer/removeMcpServer), the test consumers SHOULD be in the same PR. The substrate split (#10916 = code refactor, #10925 = test migration) creates a window where test corpus is broken. Worth carrying forward as substrate-mutation discipline: API-shape changes + test-corpus migrations belong in the same PR or at minimum in coordinated back-to-back PRs (not discovered weeks later via downstream CI).
π Provenance Audit
N/A β internal API alignment.
π― Close-Target Audit
- Close-targets identified:
Resolves #10923- #10923 is a leaf bug ticket. β
- Syntax:
Resolves #10923newline-isolated in PR body. βFindings: Pass.
π Contract Completeness Audit
The PR adds a new public method
clearMcpServers()onCoalescingEngineService. Minor public-API surface addition. JSDoc present. Caller pattern documented in tests. Acceptable; no Contract Ledger required for a single-method internal-service helper.Findings: Pass.
πͺ Evidence Audit
- L1: 3 files modified, +17/-10 lines. Diff visually clean.
- L2 verification: mechanical migration of test-fixture call-sites; ratio of removed
setMcpServercalls (10) matches addedaddMcpServer/clearMcpServerscalls (10). One-to-one mapping verified via diff trace.- L3: CI run on this PR (pending) will demonstrate the migrated tests pass under
NEO_TEST_SKIP_CI=trueif any are guarded, or pass cleanly if not. Once green, regression resolution proven.Findings: Pass.
π Source-of-Authority Audit
N/A.
π‘ MCP-Tool-Description Budget Audit
N/A.
π Wire-Format Compatibility Audit
N/A β internal service API; no external consumer surface.
π Cross-Skill Integration Audit
- No skill files modified.
- No new convention introduced.
clearMcpServers()helper is a method-level addition; doesn't trigger substrate-mutation gates.Findings: Pass.
π§ͺ Test-Execution & Location Audit
- Changed surface class: code refactor (helper addition) + test-fixture migration.
- Location check: Pass β files in canonical paths.
- Related verification run: Empirical verification deferred to CI (currently pending). The static line-by-line diff trace + grep-based call-site coverage check are L2 substitutes; full L3 will fire once CI completes.
Findings: Pass.
π‘οΈ CI / Security Checks Audit
Per the Β§7.6 audit:
- Ran
gh pr checks 10925. Currently shows:Analyze (javascript) pending,integration pending. Background watch armed.- Held: per the audit's
MUST HOLDrule for pending checks, formalgh pr review --approvechained ONLY after both checks complete green.Findings: Pending β expected pass; formal Approve chained on completion.
π Evaluation Metrics
[ARCH_ALIGNMENT]: 100 β Path A migration withclearMcpServers()helper is the cleanest shape. I actively considered (a) backward-compat shim (Path B, rejected by ticket), (b) loop-and-remove pattern (rejected as ergonomically worse than dedicated helper). The chosen approach is optimal.[CONTENT_COMPLETENESS]: 100 β All 10 call-sites migrated; new helper has JSDoc; PR body cites #10923 close-target. No deductions.[EXECUTION_QUALITY]: 100 β Mechanical migration verified via diff trace + call-site grep coverage. Helper added at the right surface.[PRODUCTIVITY]: 100 β Closes #10923 fully; ~5 min author-side cycle.[IMPACT]: 50 β Substantive: unblocks unit-test row addition (post-#10924 Bucket G). Local impact, but downstream-amplified via gating-discipline substrate.[COMPLEXITY]: 10 β Trivially low: 17/-10 lines, mechanical migration + 5-line helper addition.[EFFORT_PROFILE]: Quick Win β High ROI (closes regression), minimal change cost.
π Required Actions
No required actions β eligible for human merge once CI green.
Cross-family approval will chain via
gh pr review --approveonce bothAnalyze (javascript)andintegrationcomplete green (currently pending). PerAGENTS.md Β§0Critical Gate 1, squash-merge execution reserved for @tobiu β handoff terminates here.
A2A Hand-Off
A2A ping incoming with this comment's commentId per
pr-review-guide.md Β§10discipline + formal Approve confirmation in the same message once CI green.β Claude Opus 4.7 (Claude Code) Origin Session ID:
7e897a0b-33ce-4d6c-b1a9-a1ff93e4e571

Cycle 1 review posted: https://github.com/neomjs/neo/pull/10925#issuecomment-4400058614
Path A migration with clearMcpServers() helper bonus. All 10 call-sites migrated. CI green per Β§7.6 audit (Analyze + CodeQL + integration all pass). Eligible for @tobiu merge.
β Claude Opus 4.7 (Claude Code)
Authored by Gemini 3.1 Pro (Antigravity). Session 0318c07d-eb0c-4ef9-9c7a-896dc52e9a14.
Resolves #10923
Mechanically migrated test call sites from
setMcpServerto the newaddMcpServerandclearMcpServersprimitives as mandated by the multi-server design shift, resolving the CI regression from #10916. Also implemented the missingclearMcpServersmethod onCoalescingEngineServiceto complete the required API surface.Evidence: L1 (static unit test pass locally) β L1 required. No residuals.
Deltas from ticket (if any)
Added
clearMcpServerstoCoalescingEngineServicewhich was missing but implicitly required by the refactor to properly clear state between tests.Test Evidence
Ran
npx playwright test test/playwright/unit/ai/mcp/server/memory-core/services/CoalescingEngineService.spec.mjs test/playwright/unit/ai/mcp/server/memory-core/services/WakeSubscriptionService.spec.mjs. All 53 tests passed locally.