diff --git a/packages/dashboard/src/__tests__/chat-manager-room-hybrid.test.ts b/packages/dashboard/src/__tests__/chat-manager-room-hybrid.test.ts index 5eac88b6d..341b88db1 100644 --- a/packages/dashboard/src/__tests__/chat-manager-room-hybrid.test.ts +++ b/packages/dashboard/src/__tests__/chat-manager-room-hybrid.test.ts @@ -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", diff --git a/packages/dashboard/src/__tests__/chat-manager.test.ts b/packages/dashboard/src/__tests__/chat-manager.test.ts index f30bf2333..80e72fad9 100644 --- a/packages/dashboard/src/__tests__/chat-manager.test.ts +++ b/packages/dashboard/src/__tests__/chat-manager.test.ts @@ -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 () => {