anomalyco / anomalyco/opencode
tui: background subagent load freezes tab switching and text input
@simonklee is already working on this.
Since Aug 21, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
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
opencode2TUI 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 - Shared service PID:
29336 - CPU: Intel Core i9-14900KF, 24 cores / 32 logical processors
- 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.