feat(cli): enable explicit prompt cache options for OpenAI models on Kilo Gateway

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
This commit is contained in:
chrarnoldus
2026-08-08 18:25:29 +00:00
co-authored by kiloconnect[bot]
parent 2f72a8b72d
commit 1b0f94ec74
2 changed files with 39 additions and 2 deletions
@@ -3127,6 +3127,41 @@ describe("ProviderTransform.message - cache control on gateway", () => {
})
expect(result[1].content[1].providerOptions?.openai?.promptCacheBreakpoint).toBeUndefined()
})
test("kilo gateway with openai gpt-5.6 applies caching options", () => {
const model = createModel({
providerID: "kilo",
api: {
id: "openai/gpt-5.6",
url: "https://api.kilo.ai/api/gateway",
npm: "@kilocode/kilo-gateway",
},
id: "openai/gpt-5.6",
})
const msgs = [
{
role: "system",
content: "You are a helpful assistant",
},
{
role: "user",
content: "Hello",
},
] as any[]
const result = ProviderTransform.message(msgs, model, {}) as any[]
expect(result[0].providerOptions.openrouter).toEqual({
cacheControl: {
type: "ephemeral",
},
})
expect(result[1].providerOptions.openrouter).toEqual({
cacheControl: {
type: "ephemeral",
},
})
})
// kilocode_change end
})