test(FN-4186): complete Step 2 — add chat prompt guidance regression tests
Fusion-Task-Id: FN-4186 Fusion-Task-Lineage: 30721f11-a830-4549-aa91-d8c3186c0dcf
This commit is contained in:
24
packages/dashboard/src/__tests__/chat-system-prompt.test.ts
Normal file
24
packages/dashboard/src/__tests__/chat-system-prompt.test.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { CHAT_AGENT_MESSAGE_ROUTING_GUIDANCE, CHAT_SYSTEM_PROMPT } from "../chat.js";
|
||||
|
||||
describe("chat system prompt guidance", () => {
|
||||
it.each(["short", "crisp", "few sentences"])("includes brevity direction: %s", (token) => {
|
||||
expect(CHAT_SYSTEM_PROMPT.toLowerCase()).toContain(token);
|
||||
});
|
||||
|
||||
it("includes long-form follow-up path via fn_send_message", () => {
|
||||
expect(CHAT_SYSTEM_PROMPT).toContain("fn_send_message");
|
||||
expect(CHAT_SYSTEM_PROMPT).toContain('type: "agent-to-user"');
|
||||
expect(CHAT_SYSTEM_PROMPT).toContain('to_id: "dashboard"');
|
||||
});
|
||||
|
||||
it("combined guidance enforces additive mailbox follow-ups, not mirroring", () => {
|
||||
const combined = `${CHAT_SYSTEM_PROMPT}\n\n${CHAT_AGENT_MESSAGE_ROUTING_GUIDANCE}`;
|
||||
|
||||
expect(combined).toContain("fn_send_message");
|
||||
expect(combined).toContain('to_id: "dashboard"');
|
||||
expect(combined.toLowerCase()).toContain("must not duplicate");
|
||||
expect(combined.toLowerCase()).toContain("additive");
|
||||
expect(combined.toLowerCase()).toContain("do not also call");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user