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
Anthropic prompt caching misses when dynamic user.system is merged into the static prefix #20110
Anthropic prompt caching misses when OpenCode merges the session-static system prompt with per-turn user.system content before the request is built.
Problem
packages/opencode/src/session/llm.ts currently joins the static OpenCode system prefix with dynamic caller-provided user.system text into one system message. For Anthropic-style caching, that makes the cached system prefix change on every follow-up turn.
Expected behavior
The static OpenCode prefix should stay in its own system message so it can remain cache-stable across turns, while dynamic user.system content can vary independently.
Scope
A minimal fix would keep the static prefix as the first system message, move dynamic user.system content into a second system message, and keep plugin-added system fragments collapsed back into the trailing slot.
Activity
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.