feat: Show command hint for agents with non-default system prompts (#1314)

This commit is contained in:
Devansh Jain
2026-03-09 18:31:15 -07:00
committed by GitHub
parent 963274bb75
commit bdadd14410
3 changed files with 77 additions and 1 deletions

View File

@@ -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);
});
});