opencode v2.2.6
- Source
- github.com
- Author
- github-actions[bot]
- Date

Context
The most consequential change in opencode v2.2.6, a release of the coding that has terminal, desktop and SDK interfaces, is how the scripted opencode run command finishes. It now waits for the background shell commands, subagents and image jobs that its prompt started, then lets the model respond to their results before exiting, printing a count of the jobs it is waiting for (or a background_wait event with JSON output). There is no time limit. A job that never exits, such as a dev server or file watcher, keeps the run open until someone presses Ctrl+C or sends SIGTERM, and the notes advise setting a timeout on CI jobs. SIGTERM now cancels the session and its background jobs and exits with code 143.
Two new flags are aimed at the same scripted use. With --archived, opencode run creates the session already archived, so scripted and CI runs stay out of the inbox, the home view and session lists, and --continue skips them. With -w, or --worktree= followed by a name of your choice, the run starts in a new git worktree, a separate checkout of the repository, so its edits do not land in the current working tree; it cannot be combined with --continue or --session.
The release also stops a file in a project from running scripts on the opencode server's web origin, the address a browser treats as the server's own. File reads and media from the server API are now served as downloads, and cross-site browser navigations and requests from disallowed origins to its /api/ routes are refused. Web fetches now reject URLs that contain credentials, and Code Mode's fetch checks every redirect against the user's webfetch permission rules. The notes describe these fixes without saying whether the earlier behavior was ever exploited.
- opencode v2.2.6 adds opt-in connection pooling with pool: true, so projects with the same MCP server setup share one connection instead of each starting its own process.
- opencode run now waits for background shell commands, subagents and image jobs its prompt started before exiting, with no time limit. A dev server or file watcher keeps the run open until Ctrl+C or SIGTERM, so the release notes advise setting a timeout on CI jobs.
- For scripted runs, opencode run -w starts the session in a new git worktree and --archived keeps CI sessions out of the inbox and session lists. --worktree cannot be combined with --continue or --session.
- Security fixes serve file reads as sandboxed downloads and refuse cross-site requests to /api/*, so a project file cannot run scripts on the server's origin. Webfetch now rejects URLs containing credentials, and Code Mode fetch checks every redirect against webfetch rules.
- SIGTERM now cancels the session and its background jobs and exits with code 143, and Console config requests time out after 5 seconds so startup no longer hangs on an unresponsive Console.
- AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
- sandbox — An isolated environment where AI-generated code or agent actions run without being able to touch anything real.
- MCP — The Model Context Protocol — an open standard that lets any AI assistant plug into any tool or data source without custom integration code.
Checking sign-in…
Loading comments…






