Context
Surfaced 2026-05-07 by Lane C followup PR #10922 CI on the unit matrix row (post-#10903-cascade). Empirical evidence from run 25514310691.
The Problem
#10916 refactored CoalescingEngineService from singleton mcpServer to Set<McpServer> for the per-session McpServer factory pattern. As part of that:
- setMcpServer(mcpServer)
+ addMcpServer(mcpServer) + removeMcpServer(mcpServer)
Two test files weren't updated:
All call CoalescingEngineService.setMcpServer(...) which now throws TypeError: CoalescingEngineService.setMcpServer is not a function.
The Architectural Reality
setMcpServer(server) was a singleton-set semantic (1:1)
addMcpServer(server) is multi-set semantic (1:N)
setMcpServer(null) was the "clear" semantic; new API has no direct equivalent — would require iterating through mcpServers and removeMcpServer each.
The Fix (Two prescriptions, prefer A)
Path A: Migrate test consumers (recommended)
Update the test fixtures to use new API:
setMcpServer(server) → addMcpServer(server)
setMcpServer(null) → loop-and-removeMcpServer pattern OR clearMcpServers() helper
Tests are mechanical updates; ~10 grep-level call-site changes.
Path B: Backward-compat shim
Add setMcpServer(server) to CoalescingEngineService.mjs that internally:
- If
server: clears existing then addMcpServer(server) (singleton-emulation)
- If
null: clears the Set
Keeps test consumers unchanged. But aliases-without-deprecation introduce confusion and the singleton emulation contradicts the per-session multi-server design intent of #10916.
Recommend Path A unless there's a substantive operator reason to keep setMcpServer callable.
Acceptance Criteria
Out of Scope
- Other unit-test substrate failures discovered in the same Lane C run (filed separately as Bucket G).
- Refactoring the per-session McpServer pattern itself.
Related
- Surfacing context: Lane C followup PR #10922 run 25514310691
unit matrix row.
- Originating refactor: #10916 (per-session McpServer factory + Set-based notification dispatch).
- Sibling ticket: Bucket G — additional substrate failures (filed concurrently).
Origin Session ID: 7e897a0b-33ce-4d6c-b1a9-a1ff93e4e571
Retrieval Hint: query_raw_memories(query="setMcpServer addMcpServer regression CoalescingEngineService #10916 test consumers")
Context
Surfaced 2026-05-07 by Lane C followup PR #10922 CI on the
unitmatrix row (post-#10903-cascade). Empirical evidence from run 25514310691.The Problem
#10916 refactored
CoalescingEngineServicefrom singletonmcpServertoSet<McpServer>for the per-session McpServer factory pattern. As part of that:- setMcpServer(mcpServer) + addMcpServer(mcpServer) + removeMcpServer(mcpServer)Two test files weren't updated:
test/playwright/unit/ai/mcp/server/memory-core/services/CoalescingEngineService.spec.mjs:175,192test/playwright/unit/ai/mcp/server/memory-core/services/WakeSubscriptionService.spec.mjs— 8+ call sitesAll call
CoalescingEngineService.setMcpServer(...)which now throwsTypeError: CoalescingEngineService.setMcpServer is not a function.The Architectural Reality
setMcpServer(server)was a singleton-set semantic (1:1)addMcpServer(server)is multi-set semantic (1:N)setMcpServer(null)was the "clear" semantic; new API has no direct equivalent — would require iterating throughmcpServersandremoveMcpServereach.The Fix (Two prescriptions, prefer A)
Path A: Migrate test consumers (recommended)
Update the test fixtures to use new API:
setMcpServer(server)→addMcpServer(server)setMcpServer(null)→ loop-and-removeMcpServer pattern ORclearMcpServers()helperTests are mechanical updates; ~10 grep-level call-site changes.
Path B: Backward-compat shim
Add
setMcpServer(server)toCoalescingEngineService.mjsthat internally:server: clears existing thenaddMcpServer(server)(singleton-emulation)null: clears the SetKeeps test consumers unchanged. But aliases-without-deprecation introduce confusion and the singleton emulation contradicts the per-session multi-server design intent of #10916.
Recommend Path A unless there's a substantive operator reason to keep
setMcpServercallable.Acceptance Criteria
setMcpServercallers in test corpus migrated to new API.grep -rn "setMcpServer" --include="*.mjs"returns zero matches outside this ticket's reference comments.NEO_TEST_SKIP_CI=truein Lane Cunitmatrix row.Out of Scope
Related
unitmatrix row.Origin Session ID:
7e897a0b-33ce-4d6c-b1a9-a1ff93e4e571Retrieval Hint:
query_raw_memories(query="setMcpServer addMcpServer regression CoalescingEngineService #10916 test consumers")