Skip to content

#26749 — Plan mode reminders are not persisted in history, breaking prefix cache stability #908

@ElioNeto

Description

@ElioNeto

Description

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

  1. Start a session in Plan mode (Tab).
  2. Send a user message — OpenCode appends a synthetic plan reminder to that user message before se

[Truncado — 2082 chars totais]

Metadata

Metadata

Assignees

No one assigned

    Labels

    DORDefinition of Ready — issue meets readiness criteriaarea:corebugSomething isn't workingmedium

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions