Skip to content

feat(bedrock): add prompt caching support for custom ARNs and inference profiles#1

Open
marcelloceschia wants to merge 144 commits intodevfrom
fix/bedrock-prompt-caching-custom-arn
Open

feat(bedrock): add prompt caching support for custom ARNs and inference profiles#1
marcelloceschia wants to merge 144 commits intodevfrom
fix/bedrock-prompt-caching-custom-arn

Conversation

@marcelloceschia
Copy link
Owner

Summary

  • Enable prompt caching for Bedrock models that support it (Claude, Nova)
  • Add 'caching' option for custom ARNs/inference profiles without claude in name
  • Disable caching for Llama, Mistral, Cohere models (not supported)
  • Add comprehensive tests for all caching scenarios

Fixes

  • Prompt cache not supported for custom ARN models
  • 1M context window not configurable

Usage

Users can now configure custom ARNs like:

{
  "provider": {
    "amazon-bedrock": {
      "models": {
        "arn:aws:bedrock:...:application-inference-profile/xxx": {
          "options": { "caching": true },
          "limit": { "context": 1000000, "output": 32000 }
        }
      }
    }
  }
}

Test Plan

  • Added 15+ tests covering all caching scenarios
  • Claude models → Caching ✅
  • Nova models → Caching ✅
  • Llama/Mistral/Cohere → No Caching ❌
  • Custom ARNs with options.caching → Configurable

…ce profiles

- Enable prompt caching for Bedrock models that support it (Claude, Nova)
- Add 'caching' option for custom ARNs/inference profiles without claude in name
- Disable caching for Llama, Mistral, Cohere models (not supported)
- Add comprehensive tests for all caching scenarios

Fixes #1: Prompt cache not supported for custom ARN models
Fixes anomalyco#2: 1M context window not configurable

Users can now configure custom ARNs like:
```json
{
  "provider": {
    "amazon-bedrock": {
      "models": {
        "arn:aws:bedrock:...:application-inference-profile/xxx": {
          "options": { "caching": true },
          "limit": { "context": 1000000, "output": 32000 }
        }
      }
    }
  }
}
```
@marcelloceschia marcelloceschia force-pushed the fix/bedrock-prompt-caching-custom-arn branch from 2ed846f to e349074 Compare March 7, 2026 17:53
marcelloceschia and others added 28 commits March 7, 2026 18:57
Allows users to skip automatic database migrations by setting the
OPENCODE_SKIP_MIGRATIONS environment variable. Useful for testing
scenarios or when manually managing database state.
…w panel messaging for projects without version control
The test now validates that the database file is named according to the current installation channel (latest/beta get 'opencode.db', others get sanitized names). This ensures users' data is stored in the correct location based on their update channel.
Auto-accept now lives in the footer dock beside the thinking control so it stays easy to find without crowding the text box.

The Add file button moves to the bottom-left of the editor and the input gets a bit more bottom padding so the control row doesn’t overlap what you’re typing.
Restore the previous prompt control layout after the dock/position changes made the composer feel less familiar.

This brings auto-accept back to its prior spot and returns Add file to the previous placement.
Auto-accept now lives in the footer dock beside the thinking control so it stays easy to find without crowding the text box.

The Add file button moves to the bottom-left of the editor and the input gets a bit more bottom padding so the control row doesn’t overlap what you’re typing.
People change models and thinking settings while composing, so keeping those controls next to the Add file button avoids hunting in the footer and reduces context switching mid-message.
Gives typed text more breathing room above the Add file/model/thinking row so the controls don’t visually crowd what you’re writing.
Lets people explicitly choose between normal permission prompts and auto-accept while composing, without relying on an ambiguous icon state.
Select triggers in the composer now use the normal text color so model/thinking/permissions controls read consistently with the rest of the input UI.
… identify the app when starting a fresh session
…v so the composer stays simple"

This reverts commit ae25c1e.
@github-actions
Copy link

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

adamdotdevin and others added 26 commits March 10, 2026 19:03
…yco#16922)

Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: Brendan Allan <git@brendonovich.dev>
…lyco#16974)

Co-authored-by: wangxinxin <xinxin.wang@pharmbrain.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.