diff --git a/src/agents/pi-embedded-runner/kilocode.test.ts b/src/agents/pi-embedded-runner/kilocode.test.ts index cbb626d8ba7..71b84f06e32 100644 --- a/src/agents/pi-embedded-runner/kilocode.test.ts +++ b/src/agents/pi-embedded-runner/kilocode.test.ts @@ -2,12 +2,10 @@ import { describe, expect, it } from "vitest"; import { isCacheTtlEligibleProvider } from "./cache-ttl.js"; describe("kilocode cache-ttl eligibility", () => { - it("is eligible when model starts with anthropic/", () => { - expect(isCacheTtlEligibleProvider("kilocode", "anthropic/claude-opus-4.6")).toBe(true); - }); - - it("is eligible with other anthropic models", () => { - expect(isCacheTtlEligibleProvider("kilocode", "anthropic/claude-sonnet-4")).toBe(true); + it("allows anthropic models", () => { + for (const modelId of ["anthropic/claude-opus-4.6", "anthropic/claude-sonnet-4"] as const) { + expect(isCacheTtlEligibleProvider("kilocode", modelId)).toBe(true); + } }); it("is not eligible for non-anthropic models on kilocode", () => { @@ -15,7 +13,11 @@ describe("kilocode cache-ttl eligibility", () => { }); it("is case-insensitive for provider name", () => { - expect(isCacheTtlEligibleProvider("Kilocode", "anthropic/claude-opus-4.6")).toBe(true); - expect(isCacheTtlEligibleProvider("KILOCODE", "Anthropic/claude-opus-4.6")).toBe(true); + for (const [provider, modelId] of [ + ["Kilocode", "anthropic/claude-opus-4.6"], + ["KILOCODE", "Anthropic/claude-opus-4.6"], + ] as const) { + expect(isCacheTtlEligibleProvider(provider, modelId)).toBe(true); + } }); });