fix: follow soul.md more closely (#1434)

* Agents: honor SOUL.md persona guidance

* fix: harden SOUL.md detection (#1434) (thanks @neooriginal)

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
Neo
2026-01-23 06:00:13 +01:00
committed by GitHub
parent b65916e0d1
commit 2accb47e4d
3 changed files with 27 additions and 6 deletions

View File

@@ -237,6 +237,20 @@ describe("buildAgentSystemPrompt", () => {
expect(prompt).toContain("Bravo");
});
it("adds SOUL guidance when a soul file is present", () => {
const prompt = buildAgentSystemPrompt({
workspaceDir: "/tmp/clawd",
contextFiles: [
{ path: "./SOUL.md", content: "Persona" },
{ path: "dir\\SOUL.md", content: "Persona Windows" },
],
});
expect(prompt).toContain(
"If SOUL.md is present, embody its persona and tone. Avoid stiff, generic replies; follow its guidance unless higher-priority instructions override it.",
);
});
it("summarizes the message tool when available", () => {
const prompt = buildAgentSystemPrompt({
workspaceDir: "/tmp/clawd",