anomalyco / anomalyco/opencode

Bedrock: forked chat's first turn fails with 400 'nothing available to cache'

Open
#45,855 1 comment 0 reactions 1 assignee View on GitHub

@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
  1. Use a Claude model via @ai-sdk/amazon-bedrock.
  2. Fork a chat (creates a new, short session).
  3. Send a short first message.
  4. Request fails with HTTP 400 "nothing available to cache".
OpenCode version

1.18.24

Operating System

macOS

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.