fix: use system-reminder tags for conversation switch context (#933)

This commit is contained in:
Charles Packer
2026-02-12 14:18:16 -08:00
committed by GitHub
parent 25c11ed0a5
commit 28e67dadae
3 changed files with 25 additions and 5 deletions

View File

@@ -0,0 +1,22 @@
import { describe, expect, test } from "bun:test";
import { buildConversationSwitchAlert } from "../../cli/helpers/conversationSwitchAlert";
import { SYSTEM_REMINDER_CLOSE, SYSTEM_REMINDER_OPEN } from "../../constants";
describe("conversationSwitchAlert", () => {
test("wraps conversation switch context in system-reminder tags", () => {
const alert = buildConversationSwitchAlert({
origin: "resume-selector",
conversationId: "conv-123",
isDefault: false,
messageCount: 14,
summary: "Bugfix thread",
});
expect(alert).toContain(SYSTEM_REMINDER_OPEN);
expect(alert).toContain(SYSTEM_REMINDER_CLOSE);
expect(alert).not.toContain("<system-alert>");
expect(alert).not.toContain("</system-alert>");
expect(alert).toContain("Conversation resumed via /resume selector.");
expect(alert).toContain("Conversation: conv-123 (14 messages)");
});
});