Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/open-rules-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Fixed response times for gemini-2.5-pro-preview being very slow (minutes instead of seconds)
1 change: 0 additions & 1 deletion packages/types/src/providers/openrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export const OPEN_ROUTER_PROMPT_CACHING_MODELS = new Set([
"anthropic/claude-3.7-sonnet:thinking",
"anthropic/claude-sonnet-4",
"anthropic/claude-opus-4",
"google/gemini-2.5-pro-preview",
"google/gemini-2.5-flash-preview",
"google/gemini-2.5-flash-preview:thinking",
"google/gemini-2.5-flash-preview-05-20",
Expand Down
22 changes: 16 additions & 6 deletions src/api/providers/fetchers/__tests__/openrouter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,22 @@ describe("OpenRouter API", () => {

const models = await getOpenRouterModels()

expect(
Object.entries(models)
.filter(([_, model]) => model.supportsPromptCache)
.map(([id, _]) => id)
.sort(),
).toEqual(Array.from(OPEN_ROUTER_PROMPT_CACHING_MODELS).sort())
const openRouterSupportedCaching = Object.entries(models)
.filter(([_, model]) => model.supportsPromptCache)
.map(([id, _]) => id)

const ourCachingModels = Array.from(OPEN_ROUTER_PROMPT_CACHING_MODELS)

// Verify all our caching models are actually supported by OpenRouter
for (const modelId of ourCachingModels) {
expect(openRouterSupportedCaching).toContain(modelId)
}

// Verify we have all supported models except intentionally excluded ones
const excludedModels = new Set(["google/gemini-2.5-pro-preview"]) // Excluded due to lag issue (#4487)
const expectedCachingModels = openRouterSupportedCaching.filter((id) => !excludedModels.has(id)).sort()

expect(ourCachingModels.sort()).toEqual(expectedCachingModels)

expect(
Object.entries(models)
Expand Down
Loading