@@ -30,7 +30,7 @@ import RequestContextService from '../../../../../../ai/mcp/server/shared/servic
3030 * mechanically prevents the fail-open default — AC7a alone passes even if this path is broken).
3131 */
3232test . describe ( 'Neo.ai.services.memory-core.queryRecentTurns' , ( ) => {
33- let MemoryService , GraphService , LifecycleService , TextEmbeddingService , StorageRouter , originalGetMemoryCollection ;
33+ let MemoryService , GraphService , LifecycleService , TextEmbeddingService , StorageRouter , originalGetMemoryCollection , originalEmbedText ;
3434
3535 test . beforeAll ( async ( ) => {
3636 GraphService = ( await import ( '../../../../../../ai/services/memory-core/GraphService.mjs' ) ) . default ;
@@ -60,7 +60,10 @@ test.describe('Neo.ai.services.memory-core.queryRecentTurns', () => {
6060 await LifecycleService . ready ( ) ;
6161 }
6262
63- // Offline tests cannot hit a real embedder.
63+ // Offline tests cannot hit a real embedder. Save the original first so afterAll can restore
64+ // it: an unrestored embedText mock leaks a 4096-length vector into sibling specs sharing the
65+ // worker (e.g. the retry spec asserting a [0.1, 0.2, 0.3] return), reddening their unit run.
66+ originalEmbedText = TextEmbeddingService . embedText ;
6467 TextEmbeddingService . embedText = async ( ) => new Array ( 4096 ) . fill ( 0.1 ) ;
6568
6669 // Seed the AgentIdentity nodes the AUTHORED_BY edge + '@me' resolution depend on.
@@ -70,6 +73,7 @@ test.describe('Neo.ai.services.memory-core.queryRecentTurns', () => {
7073
7174 test . afterAll ( async ( ) => {
7275 if ( originalGetMemoryCollection ) StorageRouter . getMemoryCollection = originalGetMemoryCollection ;
76+ if ( originalEmbedText ) TextEmbeddingService . embedText = originalEmbedText ;
7377 const { cleanupChromaManager} = await import ( './util.mjs' ) ;
7478 await cleanupChromaManager ( ) ;
7579 } ) ;
0 commit comments