Skip to content

bug: aws bedrock prompt caching doesn't work correctly #11662

@rgodha24

Description

@rgodha24

Description

prompt caching on aws bedrock doesnt work

this makes running opencode thru Opus on AWS Bedrock like 10x more expensive than running it on Anthropic API.

AI diagnosis:

Evidence

Before fix:

Turn Input Cache Read Cache Write
1 ~11k ~13k ~11k
2 ~11k ~13k 0

Plugins

n/a

OpenCode version

1.1.48

Steps to reproduce

use any claude model on aws bedrock in opencode

only the system prompt (e.g. the first ~13k tokens) is read from cache

this means that its like 10x more expensive than running opencode thru official anthropic API

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions