mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-28 18:33:37 +00:00
test: restore memory test seams (#55324) (thanks @joelnishanth)
This commit is contained in:
@@ -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,
|
||||
},
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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.") ||
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user