test(FN-4530): align chat manager prompt and room store test fakes

Fusion-Task-Id: FN-4530
Fusion-Task-Lineage: f98e68fc-de86-473b-b3a2-bcec95dd74c5
This commit is contained in:
Fusion
2026-05-14 14:38:51 -07:00
committed by gsxdsm
parent edb3787ac0
commit 0e5a72bf98
2 changed files with 4 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ const mockChatStore = {
listRoomMembers: vi.fn(),
createSession: vi.fn(),
getRoom: vi.fn(),
getRoomMessages: vi.fn(),
addRoomMessage: vi.fn(),
};
@@ -18,6 +19,7 @@ describe("ChatManager room hybrid responder resolution", () => {
vi.clearAllMocks();
__resetChatState();
mockChatStore.getRoom.mockReturnValue({ id: "room-1", name: "room-1" });
mockChatStore.getRoomMessages.mockReturnValue([]);
mockChatStore.addRoomMessage.mockImplementation((_roomId: string, input: any) => ({
id: `msg-${mockChatStore.addRoomMessage.mock.calls.length}`,
roomId: "room-1",

View File

@@ -1158,7 +1158,7 @@ describe("ChatManager.sendMessage", () => {
expect(mockAgentStore.getAgent).toHaveBeenCalledWith("agent-001");
expect(createOptions.systemPrompt).toContain("Be calm and precise.");
expect(createOptions.systemPrompt).toContain("Your chat reply is the primary response to the user.");
expect(createOptions.systemPrompt).toContain("Only use `fn_send_message` when the user explicitly asks");
expect(createOptions.systemPrompt).toContain("Use `fn_send_message` only when either (a) the user explicitly asks");
});
it("includes guidance to avoid double-sending mailbox copies by default", async () => {
@@ -1180,7 +1180,7 @@ describe("ChatManager.sendMessage", () => {
await chatManager.sendMessage("chat-001", "Hello");
expect(createOptions.systemPrompt).toContain("Do not also call `fn_send_message` with the same content");
expect(createOptions.systemPrompt).toContain("Only use `fn_send_message` when the user explicitly asks for mailbox/inbox/notification delivery");
expect(createOptions.systemPrompt).toContain("Use `fn_send_message` only when either (a) the user explicitly asks for mailbox/inbox/notification delivery");
});
it("passes enriched system prompt with agent memory when agent context is available", async () => {