From 86cc247d4d7905a21fb4faaa3c5c53c827d968c5 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 9 May 2026 08:27:46 +0100 Subject: [PATCH] test: tighten realtime voice consult tool assertions --- src/talk/agent-consult-tool.test.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/talk/agent-consult-tool.test.ts b/src/talk/agent-consult-tool.test.ts index 0b61a3321ab..7819ed504a1 100644 --- a/src/talk/agent-consult-tool.test.ts +++ b/src/talk/agent-consult-tool.test.ts @@ -4,6 +4,7 @@ import { buildRealtimeVoiceAgentConsultPrompt, collectRealtimeVoiceAgentConsultVisibleText, parseRealtimeVoiceAgentConsultArgs, + REALTIME_VOICE_AGENT_CONSULT_TOOL, REALTIME_VOICE_AGENT_CONSULT_TOOL_NAME, resolveRealtimeVoiceAgentConsultToolPolicy, resolveRealtimeVoiceAgentConsultTools, @@ -28,13 +29,17 @@ describe("realtime voice agent consult tool", () => { }); it("accepts provider question aliases from realtime tool calls", () => { - expect(parseRealtimeVoiceAgentConsultArgs({ prompt: " Check the repo. " })).toMatchObject({ + expect(parseRealtimeVoiceAgentConsultArgs({ prompt: " Check the repo. " })).toStrictEqual({ + context: undefined, question: "Check the repo.", + responseStyle: undefined, }); expect( parseRealtimeVoiceAgentConsultArgs({ query: " Send a Discord message. " }), - ).toMatchObject({ + ).toStrictEqual({ + context: undefined, question: "Send a Discord message.", + responseStyle: undefined, }); }); @@ -76,8 +81,8 @@ describe("realtime voice agent consult tool", () => { expect(resolveRealtimeVoiceAgentConsultToolPolicy("bad", "safe-read-only")).toBe( "safe-read-only", ); - expect(resolveRealtimeVoiceAgentConsultTools("safe-read-only")).toEqual([ - expect.objectContaining({ name: REALTIME_VOICE_AGENT_CONSULT_TOOL_NAME }), + expect(resolveRealtimeVoiceAgentConsultTools("safe-read-only")).toStrictEqual([ + REALTIME_VOICE_AGENT_CONSULT_TOOL, ]); expect(resolveRealtimeVoiceAgentConsultTools("none")).toStrictEqual([]); expect(resolveRealtimeVoiceAgentConsultToolsAllow("safe-read-only")).toEqual([ @@ -103,10 +108,7 @@ describe("realtime voice agent consult tool", () => { expect( resolveRealtimeVoiceAgentConsultTools("safe-read-only", [duplicateConsultTool, customTool]), - ).toEqual([ - expect.objectContaining({ name: REALTIME_VOICE_AGENT_CONSULT_TOOL_NAME }), - customTool, - ]); + ).toStrictEqual([REALTIME_VOICE_AGENT_CONSULT_TOOL, customTool]); expect(resolveRealtimeVoiceAgentConsultTools("none", [customTool])).toEqual([customTool]); }); });