OpenCode 2 v2.0.18: Code Mode tool calls, generated media, GitLab sign-in#
Published by Alex Sorokoletov
Part of the OpenCode 2 Version Tracker series. | OpenCode on GitHub | OpenCode 2 docs
OpenCode 2 reached v2.0.18 across eighteen point releases since v2.0.0, all published inside a single week. The span builds out Code Mode, where the model calls tools by writing JavaScript in a sandbox, adds image, video, speech, and transcription generation across providers, and ships GitLab OAuth sign-in plus a wider programmatic session API.
New environment variables#
| Variable | What It Does |
|---|---|
OPENCODE_CLI_CONFIG_CONTENT | Pass CLI configuration inline as a string instead of pointing at a file on disk (PR #49399, v2.0.6). |
OPENCODE_GITLAB_AUTH_CLIENT_ID | Set the OAuth client ID used when signing in to GitLab (PR #50422, v2.0.16). |
Code Mode and media generation#
The largest concentration of work in this range went into Code Mode: the model drives tools by writing JavaScript that runs in a bounded interpreter rather than emitting a JSON tool call. Over eighteen releases the interpreter gained Iterator helpers and Iterator.from (#50410), Promise.withResolvers and Promise.try (#50389, #50419), tagged templates and String.raw (#50791), Function.prototype.call/apply/bind (#50831), Object.freeze/seal/create and structuredClone (#50834), and WeakMap/WeakSet (#51257). It also gained guardrails: runaway recursion fails with a RangeError at 10000 nested calls (#48891), and string, array, and promise builders carry size caps (#49019). v2.0.16 made MCP tools and resources callable from Code Mode and set MCP Code Mode defaults (#50680, #51029).[1]
Media generation landed next to it. v2.0.15 added a media foundation with Media assets and image rewrite (#49181); v2.0.16 followed with video generation (#50703), speech generation (#50883), transcription (#50910), and queued image routes spanning Black Forest Labs, fal, Replicate, and Stability (#50959).[2] AssemblyAI speaker labels arrived in v2.0.17 (#51369). Provider fixes ran wide across Bedrock, Vertex, Gemini, OpenAI Responses and Chat, Copilot, Kimi, Grok, Nova, Alibaba, and OpenRouter, most of them fitting thinking budgets to output limits and correcting tool-schema handling per model.
Programmatic surface and sign-in#
New experimental keys cover a server fs.write endpoint (#49466)[3], WebSocket send and receive hooks for plugins (#49136)[4], MCP lifecycle control (add, connect, disconnect, remove) behind the reworked SDK v2 client, session export and import backed by full-transcript export (#50733), configuration updates over the API, and an evaluation API added in v2.0.13 (#50506) and renamed to run in v2.0.15 (#50529).[5]
On auth and platform, GitLab OAuth login and workflow discovery returned (#50422)[6], password pairing gave way to one-time connect links (#50970, #50972), and device-flow sign-in to OpenCode Console and OpenCode Go landed in v2.0.16 (#48501).[7] The TUI reworked its theme system to base and mode tokens (v2.0.9) and dynamic hue names (v2.0.15, #50728), added the /btw side-question command (#49646), transcript verbosity levels (#51131), and automatic tabs mode (#50456). The desktop app picked up local device pairing (#49291), a redesigned settings panel with search (#48174), and a long run of startup-performance commits.
Inside the release#
The v2.0.0 to v2.0.18 range carries 586 commits from 23 contributors, dated within one week. rekram1-node led with 80 commits; a release bot accounted for 61; nexxeln (30) and jlongster (18) followed. Desktop startup performance work landed across the range: V8 code cache for the renderer (#49767), dropping electron-store (#49791) and electron-window-state (#49792), loading the browser pane on first use (#49774). Nearly all changes landed under packages/, and the tracked package source count reached 4,297 files. Eighteen point releases in under a week works out to roughly three a day.
What this tells us#
Code Mode is the architectural line separating OpenCode 2 from Claude Code, Codex CLI, and Gemini CLI, which drive tools through direct function-call JSON. Running model-authored JavaScript against tools needs a JavaScript runtime, which is why so many commits reimplement language built-ins and bound them; wiring MCP tools and resources into that runtime (#50680) makes them callable from generated code.
The media work moves OpenCode 2 past a text coding agent. Image, video, speech, and transcription across Black Forest Labs, fal, Replicate, Stability, and AssemblyAI extend the same catalog-aggregation approach it already uses for language models into media providers. Alongside that, Console and OpenCode Go (a $10/month plan, per the v2 docs), device-flow auth, Console-managed policies, and Console-hosted MCP give the open-source CLI a managed counterpart.
That is a wider product surface than the CLI-and-IDE shape of the closed harnesses: a terminal client, a desktop app, a server, SDKs, and a hosted console developed together. The v2 line also diverges from 1.x by consolidating on the v2 protocol, with refactors removing the workspace API, the current-project endpoint, and plugin activation waits, and by registering a native v2 theme format.
All trademarks and software referenced belong to their respective owners.
Sources
- Code Mode as MCP tools and defaults: #50680, #51029
- Media foundation and routes: #49181, #50703, #50883, #50910, #50959
- Server
fs.writeendpoint: #49466 - WebSocket plugin hooks: #49136
- Evaluation API and rename: #50506, #50529
- GitLab OAuth login: #50422
- One-time connect links and device flow: #50970, #50972, #48501
All 1 OpenCode 2 analyses: OpenCode 2 Version Tracker · Official OpenCode 2 changelog