mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-10-29 18:52:45 +08:00
feat(cli): exclude ChatGPT subscriptions from explicit prompt cache breakpoints
This commit is contained in:
@@ -3162,6 +3162,70 @@ describe("ProviderTransform.message - cache control on gateway", () => {
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
test("openai gpt-5.6 with ChatGPT subscription (zero cost) does not apply promptCacheBreakpoint", () => {
|
||||
const model = createModel({
|
||||
providerID: "openai",
|
||||
api: {
|
||||
id: "gpt-5.6",
|
||||
url: "https://api.openai.com/v1",
|
||||
npm: "@ai-sdk/openai",
|
||||
},
|
||||
id: "gpt-5.6",
|
||||
cost: {
|
||||
input: 0,
|
||||
output: 0,
|
||||
cache: { read: 0, write: 0 },
|
||||
},
|
||||
})
|
||||
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?.openai?.promptCacheBreakpoint).toBeUndefined()
|
||||
expect(result[1].providerOptions?.openai?.promptCacheBreakpoint).toBeUndefined()
|
||||
})
|
||||
|
||||
test("openai gpt-5.6 with ChatGPT backend endpoint does not apply promptCacheBreakpoint", () => {
|
||||
const model = createModel({
|
||||
providerID: "openai",
|
||||
api: {
|
||||
id: "gpt-5.6",
|
||||
url: "https://chatgpt.com/backend-api/codex/responses",
|
||||
npm: "@ai-sdk/openai",
|
||||
},
|
||||
id: "gpt-5.6",
|
||||
cost: {
|
||||
input: 0.002,
|
||||
output: 0.008,
|
||||
cache: { read: 0.0005, write: 0.002 },
|
||||
},
|
||||
})
|
||||
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?.openai?.promptCacheBreakpoint).toBeUndefined()
|
||||
expect(result[1].providerOptions?.openai?.promptCacheBreakpoint).toBeUndefined()
|
||||
})
|
||||
// kilocode_change end
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user