@@ -50,15 +50,6 @@ function fixtureFiles(): Record<string, string> {
5050 const agentEventsPath = JSON . stringify ( path . join ( repoRoot , "src" , "infra" , "agent-events.ts" ) ) ;
5151 const loggingConsolePath = JSON . stringify ( path . join ( repoRoot , "src" , "logging" , "console.ts" ) ) ;
5252 const loggingStatePath = JSON . stringify ( path . join ( repoRoot , "src" , "logging" , "state.ts" ) ) ;
53- const pluginMetadataStatePath = JSON . stringify (
54- path . join ( repoRoot , "src" , "plugins" , "current-plugin-metadata-state.ts" ) ,
55- ) ;
56- const pluginMetadataRuntimePath = JSON . stringify (
57- path . join ( repoRoot , "src" , "plugins" , "plugin-metadata-snapshot.runtime.ts" ) ,
58- ) ;
59- const pluginMetadataLifecyclePath = JSON . stringify (
60- path . join ( repoRoot , "src" , "plugins" , "plugin-metadata-lifecycle.ts" ) ,
61- ) ;
6253
6354 return {
6455 "01-dep.ts" : 'export function flavor(): string {\n return "real";\n}\n' ,
@@ -205,56 +196,6 @@ function fixtureFiles(): Record<string, string> {
205196 "});" ,
206197 "" ,
207198 ] . join ( "\n" ) ,
208- "07-a-plugin-metadata.test.ts" : [
209- `import { setCurrentPluginMetadataSnapshotState } from ${ pluginMetadataStatePath } ;` ,
210- `import { getCurrentPluginMetadataSnapshotRuntime, registerPluginMetadataSnapshotReaders } from ${ pluginMetadataRuntimePath } ;` ,
211- `import { registerPluginMetadataProcessMemoLifecycleClear } from ${ pluginMetadataLifecyclePath } ;` ,
212- 'import { expect, it } from "vitest";' ,
213- 'it("seeds process-global plugin metadata readers and their snapshot", () => {' ,
214- ' const snapshot = { source: "first-file" };' ,
215- ' const readerKey = Symbol.for("openclaw.pluginMetadataSnapshotReaders");' ,
216- ' const probeKey = Symbol.for("openclaw.test.pluginMetadataLifecycle");' ,
217- " const store = globalThis as Record<PropertyKey, unknown>;" ,
218- " const probe = { clears: 0, readers: store[readerKey] };" ,
219- " store[probeKey] = probe;" ,
220- " registerPluginMetadataProcessMemoLifecycleClear(() => { probe.clears += 1; });" ,
221- ' setCurrentPluginMetadataSnapshotState(snapshot, "first-file");' ,
222- " registerPluginMetadataSnapshotReaders({" ,
223- " getCurrentPluginMetadataSnapshot: () => snapshot," ,
224- " resolvePluginMetadataSnapshot: () => snapshot," ,
225- " });" ,
226- " expect(getCurrentPluginMetadataSnapshotRuntime({ config: {} })).toBe(snapshot);" ,
227- "});" ,
228- "" ,
229- ] . join ( "\n" ) ,
230- "07-b-plugin-metadata.test.ts" : [
231- `import { getCurrentPluginMetadataSnapshotState } from ${ pluginMetadataStatePath } ;` ,
232- `import { getCurrentPluginMetadataSnapshotRuntime } from ${ pluginMetadataRuntimePath } ;` ,
233- 'import { expect, it } from "vitest";' ,
234- 'it("clears process-global plugin metadata snapshots and reader closures", () => {' ,
235- ' const readerKey = Symbol.for("openclaw.pluginMetadataSnapshotReaders");' ,
236- ' const probeKey = Symbol.for("openclaw.test.pluginMetadataLifecycle");' ,
237- " const store = globalThis as Record<PropertyKey, unknown>;" ,
238- " const probe = store[probeKey] as { clears: number; readers: object };" ,
239- " const readers = store[readerKey] as Record<string, unknown>;" ,
240- " expect({" ,
241- " clears: probe.clears," ,
242- " getterPresent: typeof readers.getCurrentPluginMetadataSnapshot === 'function'," ,
243- " resolverPresent: typeof readers.resolvePluginMetadataSnapshot === 'function'," ,
244- " readerIdentityRetained: readers === probe.readers," ,
245- " snapshot: getCurrentPluginMetadataSnapshotState().snapshot," ,
246- " readerSnapshot: getCurrentPluginMetadataSnapshotRuntime({ config: {} })," ,
247- " }).toEqual({" ,
248- " clears: 1," ,
249- " getterPresent: false," ,
250- " resolverPresent: false," ,
251- " readerIdentityRetained: true," ,
252- " snapshot: undefined," ,
253- " readerSnapshot: undefined," ,
254- " });" ,
255- "});" ,
256- "" ,
257- ] . join ( "\n" ) ,
258199 } ;
259200}
260201
@@ -310,7 +251,7 @@ it("cleans every shared runner surface between files", async () => {
310251 // The collection failure is intentional. Every behavior test after it must
311252 // pass; any leaked surface turns the summary into a second failure.
312253 expect ( output ) . toContain ( "synthetic collect failure" ) ;
313- expect ( output ) . toContain ( "1 failed | 13 passed" ) ;
254+ expect ( output ) . toContain ( "1 failed | 11 passed" ) ;
314255 expect ( output ) . not . toContain ( "first-file" ) ;
315256 } finally {
316257 await fs . rm ( root , { recursive : true , force : true } ) ;
0 commit comments