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
tui: background subagent load freezes tab switching and text input #43891
Running many background subagents in one TUI tab systematically makes the entire TUI sluggish until the subagent load decreases. Switching tabs becomes slow and text input or draft editing can temporarily freeze.
Environment
opencode version: 0.0.0-beta-17793
OS: Microsoft Windows 10.0.26200.9168 (win32 x64)
Terminal: Unavailable: terminal environment variables are not set
Shell: C:\WINDOWS\system32\cmd.exe (diagnostics executed with PowerShell 7.6.5)
Install/channel: beta, installed as opencode2
Active plugins: aftereffects.ts, blender.ts, m365.ts, resolve.ts, unreal.ts, ponytail-v2.mjs, opencode-gemini-auth@latest, opencode-ponytail
Reproduction
Start one opencode2 TUI connected to the default shared background service.
Open multiple virtual tabs in that TUI, each showing a different session or workspace.
In one tab's primary session, launch about eight independent background subagents.
While those subagents are running, switch between tabs and type or edit a draft.
Observe delayed tab changes, sluggish input, and temporary UI freezes.
Wait for the subagent load to decrease; TUI interactivity returns to normal.
Expected Behavior
Background work in one session should not make TUI navigation or text editing unresponsive. Tab changes and draft input should remain interactive under subagent load.
Actual Behavior
The whole TUI becomes very sluggish while the subagents are active. Switching to another virtual tab is delayed, and typing or editing a draft can freeze temporarily. Interactivity returns after the load decreases. This reproduces systematically with comparable load, while the service remains healthy according to /api/health.
Additional Context
Shared service URL during the latest observation: http://127.0.0.1:49374
During one observation, the Bun server used about 3.4% total-machine CPU (roughly 1.1 logical processors), while its working set grew from about 3.36 GiB to 4.24 GiB.
The problem occurs inside one TUI process with multiple virtual tabs; no additional terminal or TUI client is involved.
It has not been determined whether background session execution also slows; the directly observed symptom is degraded TUI input and navigation.
Reducing concurrent subagent load avoids the UI stalls.
Clarification regarding the possible duplicate #42657:
This V2 report has a different runtime and CPU signature.
TUI lag with multi-subagent sessions (97% CPU on render thread) #42657 reports OpenCode V1 (1.18.18) with the TUI render thread near 97% CPU, and a follow-up reports 87-100% total CPU across 3-4 OpenCode processes. After restarting with one process, that reporter saw no input lag and peaks below 17%.
This issue reproduces on OpenCode V2 beta 0.0.0-beta-17793 inside one TUI process with multiple internal virtual tabs. The lag is present while total machine CPU remains around 14%; the shared server was observed around 3.4% of a 32-logical-processor machine. The service remains healthy.
The V2 topology also differs from launching multiple OpenCode processes:
Internal TUI tabs are views over sessions/workspaces, not separate OS processes.
In default mode, the TUI connects to one managed background server (server connection).
Subagents are child sessions registered in the process-local Job service, not worker processes (subagent, job).
No worker pool, per-session process placement, or setting that isolates internal TUI tabs was found in this beta. --standalone creates one private server for an entire TUI invocation; it does not isolate individual tabs while retaining one TUI.
The directly observed bug remains TUI input/navigation stalls under subagent load. The process-local topology may or may not be the root cause, but it means the V1 multi-process CPU-saturation report should not be assumed to explain this V2 behavior.
Activity
github-actions commentedon Aug 21, 2026
This issue might be a duplicate of an existing issue. Please check:
pascalandr commentedon Aug 21, 2026
Clarification regarding the possible duplicate #42657:
This V2 report has a different runtime and CPU signature.
1.18.18) with the TUI render thread near 97% CPU, and a follow-up reports 87-100% total CPU across 3-4 OpenCode processes. After restarting with one process, that reporter saw no input lag and peaks below 17%.0.0.0-beta-17793inside one TUI process with multiple internal virtual tabs. The lag is present while total machine CPU remains around 14%; the shared server was observed around 3.4% of a 32-logical-processor machine. The service remains healthy.The V2 topology also differs from launching multiple OpenCode processes:
No worker pool, per-session process placement, or setting that isolates internal TUI tabs was found in this beta.
--standalonecreates one private server for an entire TUI invocation; it does not isolate individual tabs while retaining one TUI.The directly observed bug remains TUI input/navigation stalls under subagent load. The process-local topology may or may not be the root cause, but it means the V1 multi-process CPU-saturation report should not be assumed to explain this V2 behavior.
github-actions commentedon Oct 21, 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.