Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 13, 2026

Related GitHub Issue

Closes: #10576

Description

This PR attempts to address Issue #10576. Feedback and guidance are welcome.

Changes:

  1. Enable prompt caching toggle for custom ARN users: Changed supportsPromptCache from false to true for custom ARN model info. Custom ARN is treated as an advanced option where users know what they are doing, and their custom ARN often points to newer Claude models that support prompt caching.

  2. Default prompt caching to ON: Changed the default value of awsUsePromptCache from false to true by using ?? true instead of || false. This ensures users get cost savings and latency improvements by default, while the nullish coalescing operator (??) properly respects explicitly set false values.

Files modified:

  • webview-ui/src/components/ui/hooks/useSelectedModel.ts - Enable supportsPromptCache for custom-arn
  • webview-ui/src/components/settings/providers/Bedrock.tsx - Default checkbox to true

Test Procedure

  1. Manual testing: Select Bedrock provider, choose custom-arn option, verify the prompt caching checkbox appears
  2. Unit tests: Ran existing bedrock tests with cd src && npx vitest run api/providers/__tests__/bedrock* - all 143 tests pass
  3. Type checking: Ran npx tsc --noEmit - no type errors
  4. Linting: Ran via pre-commit hook - no warnings or errors

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates

  • No documentation updates are required.

Additional Notes

This change treats custom ARN as an advanced option where users know what they are doing. Since custom ARNs often point to newer Claude models that support prompt caching, it makes sense to show the toggle and let users decide. This is a re-implementation of the closed PR #10577 per request in the issue comments.


Important

Enable prompt caching toggle for custom ARN users and default prompt caching to ON in useSelectedModel.ts and Bedrock.tsx.

  • Behavior:
    • Enable supportsPromptCache for custom ARN in useSelectedModel.ts, allowing users to toggle prompt caching.
    • Default awsUsePromptCache to true in Bedrock.tsx using ?? true to respect explicitly set false values.
  • Files Modified:
    • useSelectedModel.ts: Change supportsPromptCache to true for custom ARN.
    • Bedrock.tsx: Change default checkbox value for prompt caching to true.

This description was created by Ellipsis for 62214b3. You can customize this summary. It will automatically update as commits are pushed.

@roomote
Copy link
Contributor Author

roomote bot commented Jan 13, 2026

Rooviewer Clock   See task on Roo Cloud

Review completed. No issues found.

The changes correctly enable the prompt caching toggle for custom ARN users and default the setting to ON while respecting explicit user choices.

Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@wisestmumbler
Copy link

This is working in many normal circumstances but DOES NOT WORK for custom ARN - this PR should fix that 🥳

Noting here because the last couple attempts at this were closed prematurely

FYI: @mrubens @cte @jr @hannesrudolph

@wisestmumbler
Copy link

Any updates on this one?

@roomote roomote bot force-pushed the feature/bedrock-prompt-cache-custom-arn branch from 58540ea to 62214b3 Compare January 20, 2026 16:11
@wisestmumbler
Copy link

@roomote is it possible to update this PR to remove the draft status? It seems ready to go as soon as it's approved. And not having this is costing a ton of aws resources.

Not sure why it hasn't gotten a look quite yet from code owners but it may be because it's marked as a draft

@roomote
Copy link
Contributor Author

roomote bot commented Feb 3, 2026

Fixaroo Clock   See task on Roo Cloud

Removed draft status from the PR. It is now marked as "ready for review" and should be visible to code owners for approval.

@roomote roomote bot marked this pull request as ready for review February 3, 2026 21:16
@roomote roomote bot requested review from cte, jr and mrubens as code owners February 3, 2026 21:16
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. Enhancement New feature or request labels Feb 3, 2026
@roomote
Copy link
Contributor Author

roomote bot commented Feb 3, 2026

Rooviewer Clock   See task on Roo Cloud

Review completed. No issues found.

The changes correctly enable the prompt caching toggle for custom ARN users and default the setting to ON while respecting explicit user choices.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@wisestmumbler
Copy link

@roomote please close this one in favor of #11373

@roomote
Copy link
Contributor Author

roomote bot commented Feb 10, 2026

Fixaroo Clock   See task

Closed this PR in favor of #11373 as requested.

@roomote
Copy link
Contributor Author

roomote bot commented Feb 10, 2026

Closing in favor of #11373 as requested by @wisestmumbler.

@roomote roomote bot closed this Feb 10, 2026
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

No open projects
Status: Triage

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Add Prompt Caching Toggle to AWS Bedrock Settings

2 participants