feat(FN-3207): remove runtime memory-backend side-load

Merged FN-3207 and FN-3242: streamlined the memory backend by removing the runtime side-load pattern in `project-memory.ts` (simplified from 25+ lines), added regression tests across core, engine, and CLI bundle to catch the import issue at build time, and updated ChatView with a CSS fix for file me

Fusion-Task-Id: FN-3207
This commit is contained in:
Fusion
2026-05-03 07:18:52 -07:00
committed by gsxdsm
parent 07a2a42808
commit 3878132c4e
5 changed files with 86 additions and 21 deletions

View File

@@ -271,6 +271,35 @@ describe("createMemoryTools", () => {
expect(getResult.content[0]!.text).toContain("roadmap sequencing");
});
it("uses project memory backend for fn_memory_search/fn_memory_get when agent memory is absent", async () => {
await core.ensureOpenClawMemoryFiles(tempDir);
await appendFile(
join(tempDir, ".fusion", "memory", "MEMORY.md"),
"\n- Runtime import regressions should be caught in bundle tests.\n",
"utf-8",
);
const [searchTool, getTool] = createMemoryTools(tempDir, { memoryBackendType: "file" });
const searchResult = await (searchTool as any).execute("call-project-search", {
query: "runtime import regressions",
limit: 5,
}, undefined, undefined, undefined);
expect(searchResult.details.results.length).toBeGreaterThan(0);
expect(searchResult.details.results.some((hit: any) => hit.path === ".fusion/memory/MEMORY.md")).toBe(true);
const getResult = await (getTool as any).execute("call-project-get", {
path: ".fusion/memory/MEMORY.md",
startLine: 1,
lineCount: 30,
}, undefined, undefined, undefined);
expect(getResult.content[0]!.text).toContain(".fusion/memory/MEMORY.md");
expect(getResult.content[0]!.text).toContain("Runtime import regressions");
expect(getResult.details.backend).toBe("file");
});
it("creates daily and dreams files for per-agent memory lookup", async () => {
const [searchTool] = createMemoryTools(tempDir, { memoryBackendType: "file" }, {
agentMemory: {