Skip to content

fix(opencode): Keep threads waiting across background subagent and awaited shell wakes - #148

Draft
mwolson wants to merge 1 commit into
contrib/steady-mic-buttonfrom
contrib/opencode2-quiet-background-wakes
Draft

mwolson wants to merge 1 commit into
contrib/steady-mic-buttonfrom
contrib/opencode2-quiet-background-wakes

Conversation

@mwolson

@mwolson mwolson commented Nov 21, 2026

Copy link
Copy Markdown
Owner

When an OpenCode 2 background subagent, awaited background shell, or nested subagent follow-up finishes, the adapter drops it from pendingBackgroundTasks before the continuation wake run is dispatched. Between those two events the thread reads as completed with no active run, so clients fire a premature completion notification.

Keep finished background subagents, exited awaited shells, and active nested subagent follow-ups listed on the root provider thread until the wake run is dispatched, release abandoned or unstarted continuation offers, expire missing wake holds after 30 seconds, and skip already-ended subagent and awaited shell items during startup recovery so a restart in that window does not treat them as cut off.

@mwolson
mwolson added this pull request to stack #150 November 21, 2026 20:46
@mwolson
mwolson removed this pull request from stack #150 November 21, 2026 21:02
@mwolson
mwolson added this pull request to stack #153 November 21, 2026 21:02
@mwolson
mwolson removed this pull request from stack #153 November 22, 2026 04:49
@mwolson
mwolson added this pull request to stack #155 November 22, 2026 04:50
@mwolson
mwolson removed this pull request from stack #155 November 23, 2026 15:21
@mwolson
mwolson added this pull request to stack #157 November 23, 2026 15:21
…aited shell wakes

Keep finished background subagents, awaited background shells, and active nested subagent follow-ups listed on the root OpenCode 2 provider thread until their continuation wake run is dispatched, so clients no longer fire a premature completion notification in between. Release abandoned or unstarted continuation offers, expire missing wake holds after 30 seconds, and ignore already-ended subagent and awaited shell items during startup recovery so a restart in that window does not mark them cut off.

# Conflicts:
#	apps/server/src/orchestration-v2/RestartBackgroundNote.ts
@mwolson
mwolson removed this pull request from stack #157 November 23, 2026 19:20
@mwolson
mwolson changed the base branch from contrib/mobile-duplicate-working-row to contrib/steady-mic-button November 23, 2026 19:20
@mwolson
mwolson force-pushed the contrib/opencode2-quiet-background-wakes branch from 3db0b45 to ed3d801 Compare November 23, 2026 19:21
@mwolson
mwolson added this pull request to stack #159 November 23, 2026 19:22
@mwolson
mwolson removed this pull request from stack #159 November 24, 2026 17:26
@mwolson
mwolson added this pull request to stack #161 November 24, 2026 17:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant