| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
This PR fixes a bug in cache control detection for models using the Anthropic SDK. The applyCaching function previously used model.providerID === "anthropic" to determine whether to apply message-level cache control, which failed for non-Claude models (like kimi-k2.5) that use @ai-sdk/anthropic but have a different providerID. The fix changes the detection to use model.api.npm instead, correctly identifying Anthropic SDK usage regardless of the model's providerID.
Changes:
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/opencode/src/provider/transform.ts | Fixed Anthropic SDK detection in applyCaching function to use model.api.npm instead of model.providerID |
| packages/opencode/test/provider/transform.test.ts | Added test case for kimi-k2.5 model using Anthropic SDK to verify message-level cache control |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
|
Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Issue for this PR
Closes #14642
Type of change
What does this PR do?
The applyCaching function incorrectly used model.providerID === "anthropic" to detect Anthropic SDK models. This fails for non-Claude models (e.g. kimi-k2.5) that use @ai-sdk/anthropic but have a different providerID.
Changed detection to use model.api.npm:
How did you verify your code works?
Screenshots / recordings
N/A — no UI changes.
Checklist