mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-14 10:41:23 +00:00
25 lines
895 B
TypeScript
25 lines
895 B
TypeScript
import { afterEach, describe, expect, it } from "vitest";
|
|
import { clearMemoryPluginState, registerMemoryPromptSection } from "../plugins/memory-state.js";
|
|
import { buildAgentSystemPrompt } from "./system-prompt.js";
|
|
|
|
describe("buildAgentSystemPrompt memory guidance", () => {
|
|
afterEach(() => {
|
|
clearMemoryPluginState();
|
|
});
|
|
|
|
it("can suppress base memory guidance so context engines own memory prompt assembly", () => {
|
|
registerMemoryPromptSection(() => ["## Memory Recall", "Use memory carefully.", ""]);
|
|
|
|
const promptWithMemory = buildAgentSystemPrompt({
|
|
workspaceDir: "/tmp/openclaw",
|
|
});
|
|
const promptWithoutMemory = buildAgentSystemPrompt({
|
|
workspaceDir: "/tmp/openclaw",
|
|
includeMemorySection: false,
|
|
});
|
|
|
|
expect(promptWithMemory).toContain("## Memory Recall");
|
|
expect(promptWithoutMemory).not.toContain("## Memory Recall");
|
|
});
|
|
});
|