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 for custom ARN users and set default prompt caching to ON in useSelectedModel.ts and Bedrock.tsx.

  • Behavior:
    • Enable prompt caching toggle for custom ARN users by setting supportsPromptCache to true in getSelectedModel() in useSelectedModel.ts.
    • Default awsUsePromptCache to true using ?? true in Bedrock.tsx to ensure cost savings and latency improvements.
  • Files Modified:
    • useSelectedModel.ts: Modify getSelectedModel() to enable prompt caching for custom ARN.
    • Bedrock.tsx: Change default checkbox state for prompt caching to true.

This description was created by Ellipsis for 58540ea. 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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Add Prompt Caching Toggle to AWS Bedrock Settings

3 participants