OpenCode 2 v2.0.19: output token limits fit the context window, OPENCODE_SESSION_ID, ElevenLabs transcription#
Published by Alex Sorokoletov
Part of the OpenCode 2 Version Tracker series. | OpenCode on GitHub | OpenCode 2 docs
OpenCode 2 v2.0.19 follows v2.0.18 with output-token limits fitted to each model's context window and capped at 256k, a new OPENCODE_SESSION_ID that shell commands can read, and an ElevenLabs Scribe transcription route alongside fixes to how Gemini speech and transcription results are handled.
New environment variable#
| Variable | What It Does |
|---|---|
OPENCODE_SESSION_ID | Set to the active session ID in the environment of every command the shell tool runs, so scripts and hooks the agent launches can tie back to the session that invoked them (PR #51975). |
This aligns the shell tool's environment with agent conventions (#51975), so a script or hook the agent launches can read which session started it through OPENCODE_SESSION_ID.
Output token budgeting#
The default output limit is the model's catalog limit fitted to the room the prompt leaves in the context window, capped at 256k tokens (#51271, #51962). When a provider rejects a request and that rejection triggers overflow compaction, the rejection is now logged (#51582).
Transcription and speech#
This release adds an ElevenLabs Scribe transcription route (#51641) and retries transient failures on queued generation reads (#51635). Gemini speech and transcription results that arrive truncated are surfaced rather than dropped (#51379), speech assets are described in the format actually sent (#51377), and terminal generation failures are classified by provider error code (#51632). Aborted generations reject with the abort signal's reason (#51633).
Sessions, auth, and providers#
--session creates the session when the given name does not exist, instead of failing (#51405). Prompt-cache reuse improved by dropping the session ID and order instructions from cached requests (#51960), and child sessions share affinity headers so follow-up requests route consistently (#51923, #51931). The auth picker is shared between provider sign-in and MCP auth (#51006), auth attempts cancel on ctrl+c (#51484), and invalid Google API keys are classified as authentication errors (#51950). Gemini thought signatures are preserved on OpenAI Chat tool calls (#51768), and xAI reasoning summaries are requested on Responses variants (#51964).
TUI and path handling#
The diff viewer can show the last turn as a source (#51639), background shells are distinguished from interrupted commands (#51769), --prompt waits for the agent and model before auto-submitting (#51938), the open picker deduplicates projects (#51924), and model selection is skipped after an MCP connection (#51448). Separately, repository host references reject relative path segments (#51577).
What this tells us#
This range is reliability and provider hardening rather than new architecture. Output budgeting fits each request to the context window and a hard 256k ceiling; provider error classification, abort handling, and retries make generation across the model catalog fail predictably. That is consistent with OpenCode 2's catalog-aggregation approach, where the harness normalizes behaviour across many providers rather than targeting one.
The transcription and speech work extends that same aggregation into audio providers such as ElevenLabs and Gemini.
OPENCODE_SESSION_ID hands the shell tool's commands the active session ID, which a hook or wrapper script can use to correlate its own output with the session that triggered it (#51975).
All trademarks and software referenced belong to their respective owners.
Sources
- Shell tool environment: #51975
- Output token limits: #51271, #51962, #51582
- Transcription and speech: #51641, #51635, #51379, #51377, #51632
- Sessions and auth: #51405, #51960, #51006
- Repository reference segments: #51577
Previous OpenCode 2 analysis: v2.0.18 (September 27, 2026)
All 2 OpenCode 2 analyses: OpenCode 2 Version Tracker · Official OpenCode 2 changelog