anomalyco / anomalyco/opencode
File-change diff cards from other sessions leak into a session's tool-return stream (no session isolation)
@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
- Open two opencode sessions on the same workspace (e.g.
C:\...\代理软件\, which contains an untrackednethelper/directory). - In session A, actively edit files under
nethelper/(e.g. C++ headers). - In session B (which never touches
nethelper/), run any tool call. - Observe: after session B's tool returns, a collapsed card like
nethelper/src/foo.h +2 −0appears — 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
csharpLSP (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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.