From 99a313ddc19d3a396039ccce4b2bb5cf16e21578 Mon Sep 17 00:00:00 2001 From: Shakker Date: Mon, 11 May 2026 06:54:45 +0100 Subject: [PATCH] test: tighten dual-kind memory gate assertions --- .../registry.dual-kind-memory-gate.test.ts | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/plugins/registry.dual-kind-memory-gate.test.ts b/src/plugins/registry.dual-kind-memory-gate.test.ts index f2798170bd2..cfe9efcd666 100644 --- a/src/plugins/registry.dual-kind-memory-gate.test.ts +++ b/src/plugins/registry.dual-kind-memory-gate.test.ts @@ -52,15 +52,15 @@ describe("dual-kind memory registration gate", () => { }); expect(getMemoryRuntime()).toBeUndefined(); - expect(registry.registry.diagnostics).toEqual( - expect.arrayContaining([ - expect.objectContaining({ - pluginId: "dual-plugin", - level: "warn", - message: expect.stringContaining("dual-kind plugin not selected for memory slot"), - }), - ]), - ); + expect(registry.registry.diagnostics).toEqual([ + { + pluginId: "dual-plugin", + level: "warn", + source: "/virtual/dual-plugin/index.ts", + message: + "dual-kind plugin not selected for memory slot; skipping memory runtime registration", + }, + ]); }); it("allows memory runtime registration for dual-kind plugins selected for memory slot", () => { @@ -111,6 +111,8 @@ describe("dual-kind memory registration gate", () => { it("allows selected dual-kind plugins to register the unified memory capability", () => { const { config, registry } = createPluginRegistryFixture(); + const runtime = createStubMemoryRuntime(); + const promptBuilder = () => ["memory capability"]; registerTestPlugin({ registry, @@ -123,14 +125,18 @@ describe("dual-kind memory registration gate", () => { }), register(api) { api.registerMemoryCapability({ - runtime: createStubMemoryRuntime(), - promptBuilder: () => ["memory capability"], + runtime, + promptBuilder, }); }, }); - expect(getMemoryCapabilityRegistration()).toMatchObject({ + expect(getMemoryCapabilityRegistration()).toEqual({ pluginId: "dual-plugin", + capability: { + runtime, + promptBuilder, + }, }); expect( requireMemoryRuntime().resolveMemoryBackendConfig({ cfg: {} as never, agentId: "main" }),