test: restore memory test seams (#55324) (thanks @joelnishanth)

This commit is contained in:
Peter Steinberger
2026-03-26 23:32:51 +00:00
parent 5b85d0efa4
commit e46e655451
5 changed files with 12 additions and 10 deletions

View File

@@ -102,7 +102,7 @@ vi.mock("../../extensions/memory-core/src/memory/qmd-manager.js", () => ({
},
}));
vi.mock("./manager-runtime.js", () => ({
vi.mock("../../extensions/memory-core/src/memory/manager-runtime.js", () => ({
MemoryIndexManager: {
get: mockMemoryIndexGet,
},

View File

@@ -1,5 +1,5 @@
import type { MemoryIndexManager } from "../../extensions/memory-core/src/memory/index.js";
import type { OpenClawConfig } from "../config/config.js";
import type { MemoryIndexManager } from "../plugin-sdk/memory-core.js";
export async function getRequiredMemoryIndexManager(params: {
cfg: OpenClawConfig;
@@ -7,8 +7,7 @@ export async function getRequiredMemoryIndexManager(params: {
purpose?: "default" | "status";
}): Promise<MemoryIndexManager> {
await import("./embedding.test-mocks.js");
const { getMemorySearchManager } =
await import("../../extensions/memory-core/src/memory/index.js");
const { getMemorySearchManager } = await import("../plugin-sdk/memory-core.js");
const result = await getMemorySearchManager({
cfg: params.cfg,
agentId: params.agentId ?? "main",

View File

@@ -1,8 +1,6 @@
import {
getMemorySearchManager,
type MemoryIndexManager,
} from "../../extensions/memory-core/src/memory/index.js";
import type { OpenClawConfig } from "../config/config.js";
import { getMemorySearchManager } from "../plugin-sdk/memory-core.js";
import type { MemoryIndexManager } from "../plugin-sdk/memory-core.js";
export async function createMemoryManagerOrThrow(
cfg: OpenClawConfig,

View File

@@ -270,9 +270,11 @@ function collectCoreSourceFiles(): string[] {
const normalizedPluginSdkDir = normalizePath(resolve(ROOT_DIR, "plugin-sdk"));
coreSourceFilesCache = collectSourceFiles(coreSourceFilesCache, {
rootDir: srcDir,
shouldSkipEntry: ({ normalizedFullPath }) =>
shouldSkipEntry: ({ entryName, normalizedFullPath }) =>
normalizedFullPath.includes(".test.") ||
normalizedFullPath.includes(".test-harness.") ||
normalizedFullPath.includes(".test-helpers.") ||
entryName === "test-manager-helpers.ts" ||
normalizedFullPath.includes(".mock-harness.") ||
normalizedFullPath.includes(".suite.") ||
normalizedFullPath.includes(".spec.") ||

View File

@@ -14,7 +14,10 @@ export { SILENT_REPLY_TOKEN } from "../auto-reply/tokens.js";
export { loadConfig } from "../config/config.js";
export { resolveStateDir } from "../config/paths.js";
export { resolveSessionTranscriptsDirForAgent } from "../config/sessions/paths.js";
export { getMemorySearchManager } from "../../extensions/memory-core/src/memory/index.js";
export {
getMemorySearchManager,
MemoryIndexManager,
} from "../../extensions/memory-core/src/memory/index.js";
export { listMemoryFiles, normalizeExtraMemoryPaths } from "../memory/internal.js";
export { readAgentMemoryFile } from "../memory/read-file.js";
export { resolveMemoryBackendConfig } from "../memory/backend-config.js";