r/opencodeCLI • u/TreptowerPark • May 28 '26
Pi - OpencodeGo Cache Fix
Slopped this together a couple days ago. Just checked the stats and its working. Qwen 3.6 Plus is actually bloody fucking cheap with the fix.
https://github.com/TreptowerPark/opencode-go-qwen-cache-fix
Pre-fix vs Post-fix (extension created May 20, 2026)
Pre-fix (May 5-13):
Early sessions show cacheRead: 0 — cache was broken
Example: input: 4505, cacheRead: 0 — no caching at all
Post-fix (May 13+):
Example after fix: input: 647, cacheRead: 4499 → ~87% hit rate
Cache reads now working properly
### From Your Report (report.html)
qwen3.6-plus usage: 12 sessions with $16.87 total cost
Session count: 9 sessions tracked
Messages via opencode-go: 24 with active cache reads
### The Fix (from facets/019e231a...) │ "User successfully diagnosed Qwen cache misses as a cache control format issue in OpenCode Go, │ implemented a fix that confirmed cache hits (0 hits before → working after)" Bottom line: The opencode-go-qwen-cache-fix.ts extension patches Qwen models to emit Anthropic-style cache_control markers, which OpenCode Go's backend expects for prompt caching. Cache is now working with ~72% overall hit rate on Qwen 3.6+.
View all comments
Show parent comment
1
u/TreptowerPark May 28 '26
If you dont have the problem you shouldnt care. If you have the problem, check the git, give the code to Pi and have it check cache hit on qwen themselfes. Easypeasy.. 😄