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
[Bug] TUI worker terminated when clicking subagent task during parallel multi-task execution
Description
When using oh-my-openagent plugin with parallel multi-task execution, clicking on a subagent task to view its details causes the TUI to display "Worker is terminated" and all running parallel subagent tasks are aborted simultaneously.
This appears to be a TUI worker lifecycle management issue when handling concurrent subagent sessions. The error message "Worker has been terminated" is found in the opencode binary itself (confirmed via strings analysis), indicating an internal worker thread crash/termination.
Key Evidence from Logs
At timestamp 2026-05-14T01:37:05, when clicking a subagent task, the following cascade occurs:
LSP client initialization fails (likely a side effect of worker disruption):
ERROR service=lsp.client serverID=remark-language-server error=Cannot call write after a stream was destroyed initialize error
ERROR service=lsp error=LSPInitializeError Caused by: Cannot call write after a stream was destroyed Failed to initialize LSP client remark-language-server
All 5 parallel subagent sessions are simultaneously cancelled:
INFO service=session.prompt session.id=ses_1dbdece80ffeOH4FokfxNd0B7V logSpan.http.span.247=0ms cancel
INFO service=session.prompt session.id=ses_1dbdec707ffe1mykGQLg1rhL5T logSpan.http.span.248=1ms cancel
INFO service=session.prompt session.id=ses_1dbdec018ffe9FBz0wyPKuHuEJ logSpan.http.span.249=0ms cancel
INFO service=session.prompt session.id=ses_1dbdeb8e3ffeCqOd6a8ofQP2Ni logSpan.http.span.250=1ms cancel
INFO service=session.prompt session.id=ses_1dbdeb11bffed4f1JYrbejeP14 logSpan.http.span.251=0ms cancel
Multiple "Aborted process" errors on one of the subagent sessions:
ERROR service=session.processor session.id=ses_1dbdece80ffeOH4FokfxNd0B7V messageID=msg_e242154ea001HbPOoPdt0NmmLO error=Aborted process
ERROR service=session.processor session.id=ses_1dbdece80ffeOH4FokfxNd0B7V messageID=msg_e242154ea001HbPOoPdt0NmmLO error=Aborted process
ERROR service=session.processor session.id=ses_1dbdece80ffeOH4FokfxNd0B7V messageID=msg_e242154ea001HbPOoPdt0NmmLO error=Aborted process
ERROR service=session.processor session.id=ses_1dbdece80ffeOH4FokfxNd0B7V messageID=msg_e242154ea001HbPOoPdt0NmmLO error=Aborted process
ERROR service=session.processor session.id=ses_1dbdece80ffeOH4FokfxNd0B7V messageID=msg_e242154ea001HbPOoPdt0NmmLO error=Aborted process
Sessions receive abort requests:
INFO service=default http.method=POST http.url=/session/ses_1dbdece80ffeOH4FokfxNd0B7V/abort http.status=200
INFO service=default http.method=POST http.url=/session/ses_1dbdec707ffe1mykGQLg1rhL5T/abort http.status=200
INFO service=default http.method=POST http.url=/session/ses_1dbdec018ffe9FBz0wyPKuHuEJ/abort http.status=200
Root Cause Hypothesis
Based on log analysis and related issues, the problem appears to be in the TUI worker thread management (/$bunfs/root/src/cli/cmd/tui/worker.js):
When navigating to a subagent session view, the TUI attempts to load that session's content in a worker thread
During parallel multi-task execution, this worker creation/switch triggers a race condition or resource conflict
The worker is unexpectedly terminated, causing a cascade that aborts all related subagent sessions
The error message "Worker has been terminated" is present in the opencode binary:
$ strings /path/to/opencode-ai/bin/.opencode | grep "Worker has been terminated"
Worker has been terminated
Log File
Full log available at: ~/.local/share/opencode/log/2026-05-14T013613.log
Workaround
Currently, the only workaround is to avoid clicking on subagent tasks while parallel tasks are running. Users must wait for all parallel tasks to complete before viewing individual subagent results, or check progress via background_output tool instead of the TUI.
Impact
This bug makes parallel multi-agent workflows unreliable in the TUI, forcing users to either:
Use sequential task execution (slower)
Avoid viewing task details during execution (poor UX)
Risk losing all in-flight work if accidentally clicking a task
[Bug] TUI worker terminated when clicking subagent task during parallel multi-task execution
Description
When using oh-my-openagent plugin with parallel multi-task execution, clicking on a subagent task to view its details causes the TUI to display "Worker is terminated" and all running parallel subagent tasks are aborted simultaneously.
This appears to be a TUI worker lifecycle management issue when handling concurrent subagent sessions. The error message "Worker has been terminated" is found in the opencode binary itself (confirmed via
stringsanalysis), indicating an internal worker thread crash/termination.Key Evidence from Logs
At timestamp
2026-05-14T01:37:05, when clicking a subagent task, the following cascade occurs:Root Cause Hypothesis
Based on log analysis and related issues, the problem appears to be in the TUI worker thread management (
/$bunfs/root/src/cli/cmd/tui/worker.js):validateSessionthrows (as noted in terminal stuck after passing non-existent session ID to opencode -s #23981)Steps to Reproduce
task()withrun_in_background=trueor concurrentdelegate_taskcalls)Expected Behavior
Actual Behavior
Related Issues
[Bug] TUI crashes with "Unknown data message" when parsing concurrent tool calls- Similar worker.js crash during parallel subagent executionRandom TUI freeze/hang with process continuing in background- Worker thread communication failure with stack traces pointing tocancelfunction in worker.jsterminal stuck after passing non-existent session ID- "worker isn't terminated when validateSession throws, because the return in the catch path skips cleanup in thread"Shell/session interrupt regression in 1.4.2 can leave TUI...- "worker shutdown failed; downgrading to 1.3.17 fixes it"[FEATURE]: Recovery path for errored subagent sessions- Documents that aborting main session loses all in-flight parallel subagent work[Bug] Task tool loses session ID when sub-agent fails or is cancelled- Related to subagent cancellation handlingEnvironment
Additional Context
Binary Analysis
The error message "Worker has been terminated" is present in the opencode binary:
Log File
Full log available at:
~/.local/share/opencode/log/2026-05-14T013613.logWorkaround
Currently, the only workaround is to avoid clicking on subagent tasks while parallel tasks are running. Users must wait for all parallel tasks to complete before viewing individual subagent results, or check progress via
background_outputtool instead of the TUI.Impact
This bug makes parallel multi-agent workflows unreliable in the TUI, forcing users to either:
Labels suggestion:
bug,tui,worker,subagent,parallel-execution