onlyterp/prompt-cache-skills/opencode-bedrock-doc-blocks
Claude Code and agent skill by onlyterp/prompt-cache-skills
- community
Checking that the SKILL.md file is still in the repository.
OpenCode places cachePoint on Bedrock messages containing DocumentBlocks, which produces a "nothing available to cache" error.
Install
npx vskill@latest install onlyterp/prompt-cache-skills/opencode-bedrock-doc-blocksSKILL.md
OpenCode: skip cachePoint on Bedrock DocumentBlock messages (#17300)
Target
packages/opencode/src/provider/transform.ts → applyCaching() in sst/opencode.
Open issue: #17300 — "Bedrock prompt caching error: nothing available to cache".
Symptom
applyCaching() places cachePoint markers on the last 2 non-system messages. If either of those messages contains a DocumentBlock (PDF/file attachment that Bedrock processes server-side), the cachePoint lands on content that Bedrock considers non-cacheable, producing an API error:
The error fails the entire request, not just the caching attempt.
Fix
Add a DocumentBlock detector and skip cachePoint placement on affected messages, falling through to the next-most-recent stable non-document message:
Verify
- Configure OpenCode with a Bedrock Claude model.
- Attach a PDF or text document to a chat message.
- Send a follow-up prompt referencing the document.
- Before fix: Bedrock returns 400 ValidationException.
- After fix: request succeeds;
cachePointlands on the most
recent non-document message; response shows cacheReadInputTokenCount > 0 on the second identical follow-up.
Background
Bedrock's cachePoint requires that the prefix it caches contains cacheable content. DocumentBlocks are processed server-side and don't count toward the cacheable token budget — placing a cachePoint on a message where the only content is a document produces the "nothing to cache" error.
The fix is to detect document-containing messages and route the breakpoint to the next-most-stable text-bearing message.
See `docs/concepts/bedrock.md`. Full audit: `audits/opencode.md`.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/opencode-bedrock-doc-blocks/SKILL.md
Popularity
- Repository stars
- 114
- Repository forks
- 9
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/onlyterp/prompt-cache-skills/opencode-bedrock-doc-blocks)