Skip to content

Commit a904d67

Browse files
committed
refactor: only exclude google/gemini-2.5-pro-preview from caching
- More surgical approach - only exclude the specific problematic model - Keep other Google models in caching (they work fine) - Add comment explaining the exclusion with issue reference - Update test to only exclude the specific model This targets just the model causing 3+ minute lag while preserving caching benefits for other Google models that work properly.
1 parent 208969e commit a904d67

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/types/src/providers/openrouter.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ export const OPEN_ROUTER_PROMPT_CACHING_MODELS = new Set([
3939
"anthropic/claude-3.7-sonnet:thinking",
4040
"anthropic/claude-sonnet-4",
4141
"anthropic/claude-opus-4",
42+
"google/gemini-2.5-flash-preview",
43+
"google/gemini-2.5-flash-preview:thinking",
44+
"google/gemini-2.5-flash-preview-05-20",
45+
"google/gemini-2.5-flash-preview-05-20:thinking",
46+
"google/gemini-2.0-flash-001",
47+
"google/gemini-flash-1.5",
48+
"google/gemini-flash-1.5-8b",
4249
])
4350

4451
// https://www.anthropic.com/news/3-5-models-and-computer-use

src/api/providers/fetchers/__tests__/openrouter.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ describe("OpenRouter API", () => {
3434
expect(openRouterSupportedCaching).toContain(modelId)
3535
}
3636

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

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

0 commit comments

Comments
 (0)