diff --git a/src/agents/pi-embedded-runner/extra-params.google.test.ts b/src/agents/pi-embedded-runner/extra-params.google.test.ts index 8409a68e4c1..92a2356d5f9 100644 --- a/src/agents/pi-embedded-runner/extra-params.google.test.ts +++ b/src/agents/pi-embedded-runner/extra-params.google.test.ts @@ -21,6 +21,22 @@ afterEach(() => { extraParamsTesting.resetProviderRuntimeDepsForTest(); }); +function runGoogleExtraParamsCase(params?: { cfg?: unknown }) { + return runExtraParamsCase({ + ...(params?.cfg ? { cfg: params.cfg as never } : {}), + applyProvider: "google", + applyModelId: "gemini-2.5-pro", + model: { + api: "google-generative-ai", + provider: "google", + id: "gemini-2.5-pro", + } as unknown as Model<"openai-completions">, + payload: { + contents: [], + }, + }); +} + describe("extra-params: Google thinking payload compatibility", () => { it("strips negative thinking budgets and fills Gemini 3.1 thinkingLevel", () => { const payload = runExtraParamsCase({ @@ -51,7 +67,7 @@ describe("extra-params: Google thinking payload compatibility", () => { }); it("passes cachedContent through Google extra params", () => { - const { options } = runExtraParamsCase({ + const { options } = runGoogleExtraParamsCase({ cfg: { agents: { defaults: { @@ -64,16 +80,6 @@ describe("extra-params: Google thinking payload compatibility", () => { }, }, }, - } as never, - applyProvider: "google", - applyModelId: "gemini-2.5-pro", - model: { - api: "google-generative-ai", - provider: "google", - id: "gemini-2.5-pro", - } as unknown as Model<"openai-completions">, - payload: { - contents: [], }, }); @@ -83,7 +89,7 @@ describe("extra-params: Google thinking payload compatibility", () => { }); it("lets higher-precedence cachedContent override lower-precedence cached_content", () => { - const { options } = runExtraParamsCase({ + const { options } = runGoogleExtraParamsCase({ cfg: { agents: { defaults: { @@ -99,16 +105,6 @@ describe("extra-params: Google thinking payload compatibility", () => { }, }, }, - } as never, - applyProvider: "google", - applyModelId: "gemini-2.5-pro", - model: { - api: "google-generative-ai", - provider: "google", - id: "gemini-2.5-pro", - } as unknown as Model<"openai-completions">, - payload: { - contents: [], }, });