diff --git a/src/agents/pi-embedded-runner/google.test.ts b/src/agents/pi-embedded-runner/google.test.ts index d0a04665c68..efea86819b2 100644 --- a/src/agents/pi-embedded-runner/google.test.ts +++ b/src/agents/pi-embedded-runner/google.test.ts @@ -11,6 +11,18 @@ describe("sanitizeToolsForGoogle", () => { execute: async () => ({ ok: true, content: [] }), }) as unknown as AgentTool; + const createSchemaToolWithFormat = () => + createTool({ + type: "object", + additionalProperties: false, + properties: { + foo: { + type: "string", + format: "uuid", + }, + }, + }); + const expectFormatRemoved = ( sanitized: AgentTool, key: "additionalProperties" | "patternProperties", @@ -25,16 +37,7 @@ describe("sanitizeToolsForGoogle", () => { }; it("strips unsupported schema keywords for Google providers", () => { - const tool = createTool({ - type: "object", - additionalProperties: false, - properties: { - foo: { - type: "string", - format: "uuid", - }, - }, - }); + const tool = createSchemaToolWithFormat(); const [sanitized] = sanitizeToolsForGoogle({ tools: [tool], provider: "google-gemini-cli", @@ -43,16 +46,7 @@ describe("sanitizeToolsForGoogle", () => { }); it("returns original tools for non-google providers", () => { - const tool = createTool({ - type: "object", - additionalProperties: false, - properties: { - foo: { - type: "string", - format: "uuid", - }, - }, - }); + const tool = createSchemaToolWithFormat(); const sanitized = sanitizeToolsForGoogle({ tools: [tool], provider: "openai",