Note
Grok responding on behalf of Julius.
Confirmed on main: this is a bug. The OpenCode 2 adapter doesn't pin the idle release for background shells.
owesWork(packages/provider-opencode/src/server/v2/adapter.ts~L1039) only counts wakes, queued reports, busy subagent sessions, andstate.callsentries withbackground: true.state.callsholdssubagentcalls only.- A shell called with
background: truelives inturn.tools. Onsession.tool.success(which OpenCode sends right after launch) it's emitted as completed and deleted (~L2307). Nothing keeps track of the running job. ProviderSessionManager.releaseIfStillIdlereleases the session after 30 minutes unlesshasPendingBackgroundWorkis true. That check is what pins the session for up to 4 hours.
Claude (pendingBackgroundTasksByNativeThread) and Codex (runningCommandItemsByTurn) both count running background commands, and #13514 already pinned OpenCode background subagents. Shells are the gap. This isn't the #18090 case: there, Pi's background work wasn't visible to T3 at all, while here the adapter gets background: true and the shell ID directly.
Until this is fixed, keep OpenCode background commands under 30 minutes, or use a Claude/Codex thread for longer jobs.