anomalyco / anomalyco/opencode

File-change diff cards from other sessions leak into a session's tool-return stream (no session isolation)

Open
#45,874 1 comment 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Aug 28, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Describe the bug
When multiple opencode sessions share the same workspace, file-change summary cards (the collapsed "X file changed +N −M" diff cards) from other sessions are incorrectly appended to the end of this session's tool-return output.

To Reproduce

  1. Open two opencode sessions on the same workspace (e.g. C:\...\代理软件\, which contains an untracked nethelper/ directory).
  2. In session A, actively edit files under nethelper/ (e.g. C++ headers).
  3. In session B (which never touches nethelper/), run any tool call.
  4. Observe: after session B's tool returns, a collapsed card like nethelper/src/foo.h +2 −0 appears — showing session A's edits.

Expected behavior
Each session should only surface file-change cards for files it itself modified. Diff cards for another session's edits must not be rebroadcast into a different session's stream.

Root cause (hypothesis)
The file-watcher / session manager broadcasts workspace-wide change events to all sessions sharing a workspace, instead of scoping events per session. The UI is just the symptom; the leak is in the core event layer (session isolation), not the frontend.

Environment

  • OS: Windows 11 (Hyper-V VM)
  • opencode: desktop build (no TUI/CLI)
  • Workspace includes a csharp LSP (OmniSharp) and plugins @plannotator/opencode, open-controller
  • Note: a similar cross-session leak also occurs for LSP diagnostics (OmniSharp errors from session A's files show in session B).

Additional context
Both the per-session file-change cards and the cross-session LSP diagnostics point to the same missing isolation: workspace-scoped state / shared processes are not partitioned per session.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.