feat: Show command hint for agents with non-default system prompts (#1314)
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
isKnownPreset,
|
||||
SYSTEM_PROMPT_MEMFS_ADDON,
|
||||
SYSTEM_PROMPT_MEMORY_ADDON,
|
||||
shouldRecommendDefaultPrompt,
|
||||
swapMemoryAddon,
|
||||
} from "../../agent/promptAssets";
|
||||
|
||||
@@ -151,3 +152,32 @@ describe("swapMemoryAddon", () => {
|
||||
expect(countOccurrences(twice, "# See what changed")).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("shouldRecommendDefaultPrompt", () => {
|
||||
test("returns false when prompt matches current default (standard)", () => {
|
||||
const current = buildSystemPrompt("default", "standard");
|
||||
expect(shouldRecommendDefaultPrompt(current, "standard")).toBe(false);
|
||||
});
|
||||
|
||||
test("returns false when prompt matches current default (memfs)", () => {
|
||||
const current = buildSystemPrompt("default", "memfs");
|
||||
expect(shouldRecommendDefaultPrompt(current, "memfs")).toBe(false);
|
||||
});
|
||||
|
||||
test("returns true for a different preset", () => {
|
||||
const current = buildSystemPrompt("letta-claude", "standard");
|
||||
expect(shouldRecommendDefaultPrompt(current, "standard")).toBe(true);
|
||||
});
|
||||
|
||||
test("returns true for a fully custom prompt", () => {
|
||||
expect(
|
||||
shouldRecommendDefaultPrompt("You are a custom agent.", "standard"),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
test("returns true for a modified default prompt", () => {
|
||||
const current = buildSystemPrompt("default", "standard");
|
||||
const modified = `${current}\n\nExtra instructions added by user.`;
|
||||
expect(shouldRecommendDefaultPrompt(modified, "standard")).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user