Repository navigation
Re-enable Vertex Anthropic prompt caching - #886
Merged
Merged
Conversation
PR Summary by QodoRestore prompt caching for Vertex Anthropic models
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by QodoResolved findings 1.
|
nforro
approved these changes
Oct 26, 2026
BeeAI 0.1.84+ defaults allow_prompt_caching to False for every VertexAIChatModel, which silently stripped the cache_control_injection_points the reasoning agent sets. Every request then re-sent the full context as fresh input: cache read/write dropped to zero and Vertex input cost spiked. Re-enable it for Vertex Anthropic by passing allow_prompt_caching=True at construction (the adapter honors an explicit value), keyed off the public CHAT_MODEL string rather than a private attribute. Add a unit test that the flag is requested only for Vertex Anthropic, plus an end-to-end test that the transformed request retains its cache injection points. Assisted-by: Claude Opus 4.8
lbarcziova
force-pushed
the
fix-vertex-prompt-caching
branch
from
October 26, 2026 10:21
f90a5ae to
1d00b1d
Compare
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 free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
BeeAI 0.1.84+ defaults allow_prompt_caching to False for every VertexAIChatModel, which silently stripped the cache_control_injection_points the reasoning agent sets. Every request then re-sent the full context as fresh input: cache read/write dropped to zero and Vertex input cost spiked.
Re-enable it for Vertex Anthropic by passing allow_prompt_caching=True at construction (the adapter honors an explicit value), keyed off the public CHAT_MODEL string rather than a private attribute. Add a unit test that the flag is requested only for Vertex Anthropic, plus an end-to-end test that the transformed request retains its cache injection points.
Assisted-by: Claude Opus 4.8