anomalyco / anomalyco/opencode
Bedrock: forked chat's first turn fails with 400 'nothing available to cache'
Open
@neriousy is already working on this.
Since Aug 28, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Forking a chat and sending the first message fails on Claude-on-Bedrock with:
HTTP 400 — There is nothing available to cache. Please remove the invalid cache point and try again.
applyCaching() in packages/opencode/src/provider/transform.ts always stamps a Bedrock cachePoint, even when the prompt is below Bedrock's minimum cacheable size (~1024 tokens for Claude). A freshly-forked session's first turn is under that minimum, so Bedrock rejects the whole request instead of just running without a cache hit. The Anthropic API ignores an undersized cache_control; Bedrock hard-errors.
Steps to reproduce
- Use a Claude model via
@ai-sdk/amazon-bedrock. - Fork a chat (creates a new, short session).
- Send a short first message.
- Request fails with HTTP 400 "nothing available to cache".
OpenCode version
1.18.24
Operating System
macOS
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.