You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 15, 2026. It is now read-only.
The current behavior on Google Vertex is to do a Gemini cache lookup with everything prior to the final cache_control directive. Unfortunately as a workaround for a Google AI Studio bug, it's slightly different there: we have to ignore any cache_control directive on the last message, so AI studio will in that situation use the second-to-last breakpoint, if present. We're working with them on making the behavior consistent between the two upstream Google providers.
Important
Improved caching logic for various providers with new functions and tests, and made minor UI adjustments in settings components.
Caching Enhancements:
Introduced addCacheBreakpoints function for anthropic, gemini, and vertex in respective files to handle caching logic.
Removed formatMessageForCache and addCacheControlDirectives functions.
Updated anthropic-vertex.ts, glama.ts, openrouter.ts, and unbound.ts to use new caching functions.
Testing:
Added tests for addCacheBreakpoints in anthropic.test.ts, gemini.test.ts, and vertex.test.ts.
UI Changes:
Removed setCachedStateField prop from ExperimentalSettings in ExperimentalSettings.tsx and SettingsView.tsx.
This description was created by for ef7a8b7. You can customize this summary. It will automatically update as commits are pushed.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
The pull request involves changes across 9 files, with 351 lines added and 95 lines removed. The changes primarily focus on refactoring caching logic for various providers and adding tests for caching functions. The changes seem to be related to caching logic across different providers and adding tests for these caching functions. The changes are interconnected as they all deal with caching logic, which suggests they might not need to be split. I might be overlooking the possibility that some changes could be unrelated, such as the addition of tests versus the refactoring of caching logic. The addition of tests is directly related to the caching logic changes, as they verify the functionality of the new caching logic. Therefore, splitting the pull request might not be necessary. The changes in the pull request are related to caching logic and its testing, which are interconnected. It seems appropriate to keep them in a single pull request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
lgtmThis PR has been approved by a maintainersize:XLThis PR changes 500-999 lines, ignoring generated files.
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
From OpenRouter:
Important
Improved caching logic for various providers with new functions and tests, and made minor UI adjustments in settings components.
addCacheBreakpointsfunction foranthropic,gemini, andvertexin respective files to handle caching logic.formatMessageForCacheandaddCacheControlDirectivesfunctions.anthropic-vertex.ts,glama.ts,openrouter.ts, andunbound.tsto use new caching functions.addCacheBreakpointsinanthropic.test.ts,gemini.test.ts, andvertex.test.ts.setCachedStateFieldprop fromExperimentalSettingsinExperimentalSettings.tsxandSettingsView.tsx.This description was created by
for ef7a8b7. You can customize this summary. It will automatically update as commits are pushed.