OpenCode v2.2.6 shipped on November 6, the first tagged OpenCode release after the early-November digest. Its headline items: MCP servers can share one connection across projects, opencode run gains worktree and archived modes for scripted and CI runs, GUI plugins can add color themes, and phones and tablets get a touch dock for the Desktop composer. The release also fixes how the server API serves project files and how webfetch and Code Mode fetch check URLs.
Shared MCP connections
Turn on pooling for an MCP server to share one connection across projects with the same setup, so you run fewer processes and start faster. The sharing is opt-in through pool: true (improvement).
Other MCP changes in this release:
- Before a model call, OpenCode waits up to 2 seconds for MCP servers that are still connecting, so tools from servers that connect quickly reach the first prompt and
opencode run(bugfix). ~is expanded in local MCP working directories, legacy stdio servers are handled, andlogo_uriis sent during dynamic registration (bugfixes).- In Desktop, MCP sign-in now accepts a pasted redirect URL when automatic redirection is unavailable (improvement).
- In the TUI, signing in to an MCP server returns you to the
/mcplist with that server still selected (bugfix).
Scripted runs: worktrees, archived sessions, and background jobs
opencode run --worktree(-w) starts the session in a new git worktree; use--worktree=<name>to choose the worktree name. It cannot be combined with--continueor--session(improvement).opencode run --archivedcreates the session already archived, so scripted and CI runs stay out of the inbox, home, and session lists. Archived sessions are also hidden from the TUI session list and skipped by--continue(improvement).opencode runnow waits for the background shell commands, subagents, and image jobs that its prompt started, then lets the model respond to their results before it exits. While it waits, it printswaiting for N background job(s)(abackground_waitevent with--format json). There is no time limit: a job that never exits, such as a dev server or file watcher, keeps the run open until you press Ctrl+C or send SIGTERM, so set a timeout on CI jobs (bugfix).- Noninteractive
opencode runexecution was reworked so arguments, cancellation, compiled WebSocket upgrades, and service shutdown complete reliably. SIGTERM now cancels the session and its background jobs and exits with code 143 (bugfix).
Server API and fetch fixes
- File reads and media from the server API are now served as sandboxed downloads, and cross-site browser navigations and requests from disallowed origins to
/api/*are refused, so a file in your project cannot run scripts on the server’s origin (bugfix). - Webfetch and Code Mode
fetchnow reject URLs that contain credentials and ignore the#fragmentwhen matching permission rules, and Code Modefetchchecks every redirect against your webfetch rules (bugfix). - OpenCode asks for
external_directorypermission beforesession_moveleaves the current project (bugfix).
GUI plugins and Desktop
- GUI plugins can now add color themes, render or add actions to code blocks, and use native settings and menu components.
- On phones and tablets, composer actions now sit in a touch dock above the keyboard, with 44px action targets and predictable multiline input (improvement).
- The tab menu adds close-other-tabs and close-tabs-after actions, and Desktop adds unread-session grouping in Inbox and failed-run indicators on tabs (improvements).
- Prompt history now keeps up to 200 prompts; past the newest 100, only prompts without attachments are kept (improvement).
- While an input method is composing text, Escape, Enter, and Tab go to the input method instead of stopping the agent or picking a suggestion (bugfix).
How to use
- Shared MCP connections: set
pool: trueon the MCP servers you want to share across projects with the same setup. - Scripted and CI runs: add
-wor--worktree=<name>toopencode runto start in a new git worktree, and--archivedto keep the session out of your inbox and session lists. Becauseopencode runnow waits for background jobs with no time limit, set a timeout on CI jobs. - Keep your reading position: in the TUI, choose Keep under Scroll on send in Settings (
session.submit_scroll: "keep").
Also worth knowing
- The TUI adds Scroll on send in Settings: choose Keep (
session.submit_scroll: "keep") to retain your reading position after submitting a prompt (improvement). - Provider requests are retried while their host is unreachable, and prematurely ended Cohere streams are recovered (bugfix).
- Legacy custom providers whose models set only part of
limit, such as onlylimit.context, are kept instead of dropping the whole provider without an error (bugfix). - Ctrl+Z can suspend OpenCode while a form or dialog is open (bugfix).
- Provider- and model-specific session warming settings are added, including an
interval: "auto"mode based on cache TTL (improvement). - The
websearch.usepolicy action is added, and all feature flags can be enabled withOPENCODE_FLAGS=allorexperimental.all_flags(improvement). - An experimental bytecode VM for Code Mode is added. It is off by default; turn it on with
experimental.codemode_vm: trueorOPENCODE_FLAGS=codemode_vm(improvement). - Microsoft Store installations of PowerShell 7 on Windows are supported, and Azure Messages support is added for Foundry Claude models (improvements).
- OpenCode Console config requests time out after 5 seconds, so startup no longer hangs when the Console accepts the connection but never answers (bugfix).
opencode acpnow removes a session that a client creates withsession/newand closes without prompting, so IDE integrations no longer leave empty sessions behind (bugfix).
For the full list of changes, see the v2.2.6 release notes, and follow the release feed for the next tag.