mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-30 01:06:11 +00:00
fix: add context-file path regression test (openclaw#14903) thanks @0xRaini
This commit is contained in:
@@ -301,6 +301,23 @@ describe("buildAgentSystemPrompt", () => {
|
||||
expect(prompt).toContain("Bravo");
|
||||
});
|
||||
|
||||
it("ignores context files with missing or blank paths", () => {
|
||||
const prompt = buildAgentSystemPrompt({
|
||||
workspaceDir: "/tmp/openclaw",
|
||||
contextFiles: [
|
||||
{ path: undefined as unknown as string, content: "Missing path" },
|
||||
{ path: " ", content: "Blank path" },
|
||||
{ path: "AGENTS.md", content: "Alpha" },
|
||||
],
|
||||
});
|
||||
|
||||
expect(prompt).toContain("# Project Context");
|
||||
expect(prompt).toContain("## AGENTS.md");
|
||||
expect(prompt).toContain("Alpha");
|
||||
expect(prompt).not.toContain("Missing path");
|
||||
expect(prompt).not.toContain("Blank path");
|
||||
});
|
||||
|
||||
it("adds SOUL guidance when a soul file is present", () => {
|
||||
const prompt = buildAgentSystemPrompt({
|
||||
workspaceDir: "/tmp/openclaw",
|
||||
|
||||
Reference in New Issue
Block a user