Skip to content

[Bug]: DCP context window may leak pre-fork messages after /fork message (model issue uncertain) #457

@InCerryGit

Description

@InCerryGit

Bug Description

After using /fork message in an opencode session, subsequent DCP (Dynamic Context Pruning) calls sometimes include message content from before the fork point in the active conversation context. This means messages previously seen in the pre-fork session unexpectedly reappear. It is unclear whether the root cause is the model itself, DCP context boundary management, or some other backend process. Please investigate. Steps to reproduce and some environmental info are below.

Expected Behavior

After forking a conversation with /fork message, DCP should only consider messages from the forked session as context. Content from before the fork point should not bleed into new DCP calls in the forked session.

Debug Context Logs

It is difficult to reproduce, and no valid logs have been captured so far.

Tool Call Details

/fork message was used in an opencode session. On the first or subsequent DCP call after the fork, content from before the fork was included in the window — but it is not clear if this is a DCP, backend, or model-level issue.

DCP Version

@tarquinen/opencode-dcp@3.1.0

Opencode Version

1.3.2

Model

Other (specify in description)

Additional Context

To reproduce:

  1. Start an opencode conversation for a while
  2. Use /fork message to fork the session
  3. Continue the conversation from the new fork
  4. Observe if any DCP call includes messages from before the fork.

Root cause might be improper fork/context scoping, cache leakage, or model-side memory, but it's not yet clear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions