Agent Upstart

Cool things people are building with agents — and practical help getting the most out of them.

Playbooks · Coding tasks

OpenCode 2.2.6: scripted sessions, clean trees

Written November 8, 2026

OpenCode 2.2.6 runs scripted sessions in fresh worktrees with one shared MCP connection. What it writes, and what to check after a run.

What 2.2.6 adds

OpenCode 2.2.6, released November 6, 2026, is a scripting release: three changes aimed at running OpenCode from scripts and CI instead of from the terminal. The release notes list them under shared MCP connections, scripted runs in worktrees, and automatically archived runs.

The change that can hang your CI

The same release changes how opencode run waits. It now waits for the background shell commands, subagents, and image jobs its prompt started, then lets the model respond to their results before it exits. While it waits, it prints waiting for N background job(s). 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. The release notes say so plainly — set a timeout on CI jobs.

Related to that: SIGTERM now cancels the session and its background jobs and exits with code 143. A CI job that kills the run with SIGTERM gets a clean 143 rather than a hanging process, provided the timeout is actually set. Without the timeout, there is nothing to send the signal.

What to check after a scripted run

  1. What landed in the worktree. --worktree cannot be combined with --continue or --session, so each scripted run starts fresh. List the worktree after the run and diff it against the base branch before merging anything back.
  2. What the inbox shows. A run with --archived should not appear in the inbox or the session lists. If it does, the flag did not take — check that the run actually used 2.2.6 and that the flag was on the run command, not on a wrapper.
  3. What the shared MCP connection served. Pooling shares one connection across projects with the same setup. If two projects configure the same server differently, they do not share — check that the setups match before assuming one connection is serving both.
  4. Whether anything is still running. The no-timeout wait means a scripted run can outlive the CI step that started it. Check for leftover dev servers or watchers after the run exits, and confirm the CI timeout fired if the run was killed.

What this release does not do

Limits

Related playbooks

Sources

Back to: Coding playbooks hub · Also: Use Claude Code login inside OpenCode · Manage Git worktrees for parallel AI agents with Worktrunk · Run parallel subagents in Claude Code