Feature hasn't been suggested before.
Describe the enhancement you want to request
Problem:
The Editor Context Protocol automatically attaches the current editor file/selection to every prompt via WebSocket. This works well for a single opencode window, but breaks se
ssion isolation when running multiple opencode windows in parallel.
Concrete scenario:
I often run 2–3 opencode TUI windows side-by-side for different tasks:
- Window A: working on
backend/api.ts
- Window B: working on
frontend/page.tsx
- Window C: working on
docs/README.md
Since all windows connect to the same VS Code instance via WebSocket, every window receives the same editor context (the file currently focused in VS Code). This means:
- Window A's prompts get polluted with
frontend/page.tsx context when I'm actually asking about the backend
- Window B's prompts get polluted with
backend/api.ts context when I'm working on the frontend
- The session context is no longer isolated per window
Root cause:
There is no way to disable editor context auto-attachment per window. The only workaround is uninstalling the VS Code extension entirely, which also breaks @mention file autoc
omplete.
Proposed solution:
Add a per-window toggle command in the TUI command palette (Ctrl+K) to enable/disable editor context auto-attachment. The state should be persisted in the local KV store (kv. json) per workspace/session.
Expected behavior:
- When enabled (default): current behavior — blue file label shows, selection auto-attached
- When disabled: no editor context injected, but WebSocket stays alive for
@mention autocomplete
- Each opencode window has its own toggle state
Benefits:
- Restores session isolation for multi-window workflows
- Prevents token waste from irrelevant file context
- Keeps editor integration alive for manual
@mention when needed
- Small, focused change with minimal surface area
Scope:
packages/opencode/src/cli/cmd/tui/context/editor.ts
packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
- Unit tests
I am willing to implement and submit a PR if the core team approves.

Feature hasn't been suggested before.
Describe the enhancement you want to request
Problem:
The Editor Context Protocol automatically attaches the current editor file/selection to every prompt via WebSocket. This works well for a single opencode window, but breaks se
ssion isolation when running multiple opencode windows in parallel.
Concrete scenario:
I often run 2–3 opencode TUI windows side-by-side for different tasks:
backend/api.tsfrontend/page.tsxdocs/README.mdSince all windows connect to the same VS Code instance via WebSocket, every window receives the same editor context (the file currently focused in VS Code). This means:
frontend/page.tsxcontext when I'm actually asking about the backendbackend/api.tscontext when I'm working on the frontendRoot cause:
There is no way to disable editor context auto-attachment per window. The only workaround is uninstalling the VS Code extension entirely, which also breaks
@mentionfile autocomplete.
Proposed solution:
Add a per-window toggle command in the TUI command palette (
Ctrl+K) to enable/disable editor context auto-attachment. The state should be persisted in the local KV store (kv. json) per workspace/session.Expected behavior:
@mentionautocompleteBenefits:
@mentionwhen neededScope:
packages/opencode/src/cli/cmd/tui/context/editor.tspackages/opencode/src/cli/cmd/tui/component/prompt/index.tsxI am willing to implement and submit a PR if the core team approves.