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
Plan mode reminders are not persisted in history, breaking prefix cache stability #26749
Plan-mode synthetic reminders are appended to the current user message in memory before the prompt is sent, but the synthetic part is never persisted to message history. On the next turn, the same historical user message is serialized differently for the model: the first time it carries the plan reminder, on later turns it does not.
This makes the model-visible conversation unstable across turns and breaks prompt/prefix caches in OpenAI-compatible backends that require a token-identical prefix (LM Studio, llama.cpp, vLLM, LiteLLM proxies, etc.).
This is the same class of bug as #21518 (queued user messages serialized inconsistently), but for plan-mode reminders specifically. It is distinct from #24121 / #24343, which are about plan reminders leaking into Build mode after a switch — that flow strips reminders, while this issue is that the reminder for the current plan turn is not retained in stored history.
Expected: the user message stored in history is identical to what was sent to the model on the original turn, so the model sees a stable prefix on every following turn.
Actual: the original turn includes the reminder; replays of that historical message on later turns omit it, breaking the cache prefix and changing model-visible context.
Plugins
None
OpenCode version
1.14.46
Steps to reproduce
Start a session in Plan mode (Tab).
Send a user message — OpenCode appends a synthetic plan reminder to that user message before sending it to the model.
Continue the session for at least one more turn.
Inspect the model inputs sent on the second turn vs. the first turn:
First turn: the user message contains the synthetic plan reminder.
Second turn (same historical user message): the synthetic reminder is gone.
On a backend with prefix caching (LM Studio, llama.cpp, vLLM, etc.), observe a large prompt-cache miss on turn 2 even though the conversation history has not meaningfully changed.
Activity
github-actions commentedon Jul 10, 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.