Skip to content

fix: apply content-level caching for non-anthropic providers#1305

Merged
thdxr merged 1 commit into
anomalyco:devfrom
neominik:fix/openrouter-caching
Jul 25, 2025
Merged

fix: apply content-level caching for non-anthropic providers#1305
thdxr merged 1 commit into
anomalyco:devfrom
neominik:fix/openrouter-caching

Conversation

@neominik

Copy link
Copy Markdown
Contributor

Fixes #1245

- Refactor provider options into reusable object
- Apply cache control to content items for providers other than Anthropic
- Anthropic handles content-level caching natively, others need explicit control
@thdxr

thdxr commented Jul 25, 2025

Copy link
Copy Markdown
Member

thanks for tracking this down!

@thdxr
thdxr merged commit 827469c into anomalyco:dev Jul 25, 2025
@thdxr

thdxr commented Jul 25, 2025

Copy link
Copy Markdown
Member

hm actually looking closer this uses your new logic for all non-anthropic providers right? it should maybe only use it for openrouter?

i guess you're saying all providers need it in the content except anthropic because its adapter moves it forward for you

@neominik

neominik commented Jul 25, 2025

Copy link
Copy Markdown
Contributor Author

I had openrouter only at first, but then thought that other providers might have the same issue. Not sure which option is best ¯\_(ツ)_/¯

Looking at other providers, I can see that the fix will benefit github-copilot as well. Caching probably wont work on bedrock anyways and I'm not sure about the vercel gateway.

pepperpepperpepper pushed a commit to pepperpepperpepper/opencode that referenced this pull request Jul 29, 2025
achembarpu pushed a commit to achembarpu/opencode that referenced this pull request Aug 4, 2025
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
avion23 pushed a commit to avion23/opencode that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Anthropic caching not really working via OpenRouter

2 participants