-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Bedrock Prompt Caching Improvements #3099
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi Rony, Hope you are well mate. Sent you a message on discord, but don't think you have seen. I came across this PR... I have a custom Roo version that I integrated this change into yesterday (it is used in-house at our company, so unfortunately also has many other bespoke tweaks), I can help test your change. Anything that I should be aware of, pay special attention to?
|
Hi @vagadiya The current PR doesn't work with multi-point-strategy which I restored in another version. My thought was to have the first system prompt also cached, which is not cached for the moment. To your question -
|
Hi Rony, are you active on discord? We could continue the conversation there faster? |
9a41e1d
to
3bd79fd
Compare
3bd79fd
to
55d3b23
Compare
55d3b23
to
30c439b
Compare
PR RooCodeInc#3009 has an important fix, alerted to me by @jbbrown It was a one liner so I pulled it in. This brings up a question can we merge PR's in the GH UI?
Related GitHub Issue
Closes: #3836
Description
This PR fixes an issue with system prompt caching on the first message when using AWS Bedrock. The problem was that the system prompt wasn't being properly cached because we were returning a new system block without cache points instead of using the cache strategy's result.
The fix changes the
convertToBedrockConverseMessages
method inbedrock.ts
to usecacheResult.system
instead of creating a new system block. This ensures that any cache points determined by the cache strategy are properly included in the system prompt when sending the request to Bedrock.Key implementation details:
cacheResult.system
which includes both the system prompt text and any cache pointsTest Procedure
cacheReadTokens
andcacheWriteTokens
Type of Change
src
or test files.Pre-Submission Checklist
npm run lint
).console.log
) has been removed.npm test
).main
branch.npm run changeset
if this PR includes user-facing changes or dependency updates.Screenshots / Videos
N/A - This is a backend fix with no UI changes.
Documentation Updates
Additional Notes
The fix is minimal and focused on ensuring the system prompt caching works correctly on the first message. The change is a one-line modification that uses the existing cache strategy's result instead of creating a new system block.
Get in Touch
Discord: ronyblum
Important
Fixes system prompt caching issue in
convertToBedrockConverseMessages
inbedrock.ts
by usingcacheResult.system
for consistent caching behavior.convertToBedrockConverseMessages
inbedrock.ts
by usingcacheResult.system
instead of creating a new system block.This description was created by
for 30c439b. You can customize this summary. It will automatically update as commits are pushed.