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
When task.ts (subagent/subtask tool) encounters an error after starting the subagent session, Effect.orDie silently swallows the error, and the subagent session continues running orphaned in the background while the main agent proceeds with an empty tool result — causing double processing.
Root Cause Chain
1. tool.ts:145 — Framework-level Effect.orDie
All V1 tool executions are wrapped by Effect.orDie in the wrap() function. Any Effect.fail(...) from the tool's execute function becomes a defect instead of a visible error. The main agent receives an empty/malformed result.
2. task.ts — Cleanup only on interrupt, not on defect
The acquireUseRelease block only cancels the subagent on interruption. When Effect.orDie converts an error to a defect, the fiber exit is not an interrupt — it's a defect failure. Exit.hasInterrupts(exit) returns false, so background.cancel(nextSession.id) is never called. The subagent session continues running.
3. runner/llm.ts — Tool fiber failure propagates as run() failure
In the SessionRunner, the tool fiber failure propagates up and causes run() to fail. The orchestrator may retry run(), starting a new main-agent turn while the orphaned subagent is still working → double processing.
Impact
Subagent sessions become orphaned background processes
Main agent proceeds as if the subtask finished (empty result) or observes a failure
Both agents modify the same files/topics simultaneously
Token waste from duplicate work
Potential data corruption from concurrent file edits
Affected Version
OpenCode v1.17.3 (root cause dates to commit 3910a6e, Apr 23, 2026)
Activity
github-actions commentedon Aug 10, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.