OpenCode 2 v2.2.5: percentage compaction buffer, worktree and shell-mode shortcuts#
Published by Alex Sorokoletov
Part of the OpenCode 2 Version Tracker series. | OpenCode on GitHub | OpenCode 2 docs
OpenCode 2 v2.2.5 follows v2.2.4. The compaction.buffer setting now takes a percentage of each model's context window, so one value fits small and large windows (#60647). MCP servers that send stdio messages over 10 MiB stay connected and read faster (#60694), and the desktop app adds keyboard shortcuts for choosing a worktree, its base branch, and toggling shell mode (#60713).
Compaction#
compaction.buffer accepts a percentage such as "20%" alongside a token count (#60647). The config docs describe buffer as the share of the model's context window kept free before automatic compaction starts, so a single value in opencode.json holds across models with different window sizes, and token counts still work.
Two more changes route a full window into compaction. When the input limit is larger than the model's context window, compaction caps its prompt at the context window (#60660). A LiteLLM context-window error now starts compaction so the session continues (#60692).
Tool errors and the bash alias#
Two tool errors carry more detail. When read targets a missing folder, the error names that folder and the nearest one that exists (#60688). When edit can't find its oldString, the error shows the file's closest matching lines, or reports that the change is already present (#60689).
A tool call named bash now runs as shell with the same permissions. A plugin tool actually named bash still takes precedence (#60687).
MCP and session state#
MCP servers that send stdio messages larger than 10 MiB stay connected, and large messages are read much faster (#60694). An idle location no longer restarts its MCP servers right after shutting them down (#60668). The connect menu, in both the TUI and the desktop app, stops listing MCP servers, which are managed in their own place (#60675).
Switching models or resuming an interrupted response keeps reasoning content intact, which avoids the request errors some providers returned when that content was flattened to plain text (#60498).
Desktop shortcuts and quotes#
The desktop app adds keyboard shortcuts, shown in tooltips, for choosing a worktree and its base branch, plus a shortcut to toggle shell mode; the worktree path can be selected to copy the full directory (#60713). In the quote popup, holding ⌘ or Ctrl sends a quote and its comment directly, leaving the rest of the composer untouched (#60640). Desktop also gains flat input surfaces and a compact input size (#60598), and the recently closed menu's search field gets its missing top inset (#60652).
| Shortcut | Action |
|---|---|
⌘⌥O / Ctrl+Alt+O | Choose a worktree (#60713) |
⌘⌥B / Ctrl+Alt+B | Choose its base branch (#60713) |
⌘⇧X / Ctrl+Shift+X | Toggle shell mode in the composer (#60713) |
⌘Enter / Ctrl+Enter | In the quote popup, send just that quote and its comment (#60640) |
Compaction becomes the handler for a full context window#
The context-window buffer is now proportional, so a compaction.buffer written once for a small-window model keeps the same free margin when the project later runs a large-window model, with no edit to the config (#60647). Alongside it, compaction capping its own prompt at the context window (#60660) and starting on a LiteLLM context-window error (#60692) make the moment a run reaches its ceiling a compaction step inside the session.
The MCP changes work on the other side of a long run, where a connection drops. A 10 MiB stdio ceiling and an idle-restart fix (#60694, #60668) keep servers attached through traffic and lifecycle events that cut them before, and preserved reasoning across a model switch or resume (#60498) means crossing a session boundary no longer forfeits provider state that a request depended on.
All trademarks and software referenced belong to their respective owners.
Previous OpenCode 2 analysis: v2.2.4 (November 3, 2026)
All 26 OpenCode 2 analyses: OpenCode 2 Version Tracker · Official OpenCode 2 changelog