You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Review's system text is missing from compaction and warming requests, which breaks prompt caching #53
On OpenCode 2, the review plugin adds its guidance to the system prompt using only the context hook (index.ts#L312). Compaction and session warming build their requests through the compaction and generate hooks, so their system prompt is different and they miss the prompt cache. OpenCode fixed the same problem in its own plugins in anomalyco/opencode#48749.
Registering the same handler on all three hooks fixes it:
Thank you so much for this report @rzane, it's honestly one of the best I've received: a clear diagnosis, a pointer to the upstream fix, the exact patch, and steps to reproduce. That made this really easy. Sorry for the late answer. I got on it as soon as I saw it.
It's fixed in 0.11.2, which is out now (#54). Your diagnosis was spot on. It also went further than Review: Shell and Trail add system text the same way, so all three now register the handler on context, compaction and generate.
To be sure it actually fixes the cache miss, I tested it on OpenCode 2 with a small observer plugin. It logs each request's system block after every hook has run. I sent a prompt, then compacted the session:
primary request
compaction request
0.11.1
9 parts
4 parts, different hash
0.11.2
9 parts
9 parts, identical hash
Compaction and warming now send the same system prefix as the conversation, so they should read from the cache instead of writing it again.
Update with opencode plugin add @opencode-cockpit/review@0.11.2, or let the updater pick it up. If you still see cache writes after a warm-up, please reopen this and I'll take another look. Thanks again! 🙏
Activity
Codestz commentedon Oct 31, 2026
Thank you so much for this report @rzane, it's honestly one of the best I've received: a clear diagnosis, a pointer to the upstream fix, the exact patch, and steps to reproduce. That made this really easy. Sorry for the late answer. I got on it as soon as I saw it.
It's fixed in 0.11.2, which is out now (#54). Your diagnosis was spot on. It also went further than Review: Shell and Trail add system text the same way, so all three now register the handler on
context,compactionandgenerate.To be sure it actually fixes the cache miss, I tested it on OpenCode 2 with a small observer plugin. It logs each request's system block after every hook has run. I sent a prompt, then compacted the session:
Compaction and warming now send the same system prefix as the conversation, so they should read from the cache instead of writing it again.
Update with
opencode plugin add @opencode-cockpit/review@0.11.2, or let the updater pick it up. If you still see cache writes after a warm-up, please reopen this and I'll take another look. Thanks again! 🙏