You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: OpenCode: a resumed background subagent's report settles an older call, leaving the newest one running forever #26319
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
In an OpenCode 2 thread, start a background subagent and resume it several times (the subagent tool called again with the same sessionID). Each call gets its own subagent item in T3.
Have one of those runs' reports not reach T3 (or reach it out of order).
Keep resuming the child.
Expected behavior
A report settles the call it answers. If OpenCode's report can't name the call, the newest open call for that child is the one running; older open calls for the same child have necessarily ended (a child runs one job at a time) and can be settled too.
Actual behavior
T3 attaches each report to the first call in state.calls whose child is the reporting session (onReport in packages/provider-opencode/src/server/v2/adapter.ts), not to the call that started that run:
As long as every report arrives, the oldest open call is also the right one. Once one is missed, everything shifts by one: each later report closes an older call with the newer report's text, and the newest call stays "running" with no way to settle.
Seen on 0.1.3-nightly.20261026.3710 with OpenCode 2.1.4: one child resumed about 40 times in a day. From some point on six calls stayed running although OpenCode delivered all five of their reports; a call started at 21:20 holds the report text of a call started at 03:25; one report closed four calls at once. Two other threads each have one call stuck the same way, with the child session idle in OpenCode for hours. The stuck items keep the parent's Lineage cards "Running", and anything that asks T3 whether a thread is busy treats it as busy indefinitely. Still the same code on main 658c9da.
Activity