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
The TUI emits repeated Possible EventEmitter memory leak detected warnings for terminal resize listeners during normal use. Listener count keeps growing across resizes/tab switches instead of being cleaned up, so long-running sessions accumulate leaked listeners.
Active plugins: ~/.config/opencode/plugins/herdr-agent-state.js, ~/.config/opencode/plugins/moshi-hooks.ts
Reproduction
Start the v2 TUI in Ghostty.
Use it normally: switch tabs/sessions, resize the terminal window a few times, let agents run.
Observe stderr/log output over time.
Expected Behavior
Resize listeners added by the renderer are removed when the render root/tab is torn down, or the emitter uses setMaxListeners; no warnings appear.
Actual Behavior
Repeated warnings, timestamped across a session:
[WARN] 'Possible EventEmitter memory leak detected. 11 resize listeners added to [Si]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit'
The [Si] target is a minified internal class (terminal/viewport object). Count stays pinned at "11" per burst but the warning re-fires continuously, suggesting listeners are added on every layout pass without removing previous ones.
Also seen once alongside it:
[WARN] 'Anchor is the same as the node box-29847 being inserted, skipping insertBefore'
Additional Context
Happens intermittently but reproducibly; correlates with window resizes and tab activity (timestamps line up with resize moments).
Warnings are non-fatal but grow noise in logs and indicate unbounded listener accumulation in long sessions.
Based on my experience the memory leak happens only when the sidebar is open. If the sidebar is disabled, things are fine but the prompt box goes disappears unless the terminal is resized to it's state before the opencode is opened.
Yeah this makes opencode not usable at all for me. If i resize the terminal even by accident my computer will freeze and i have to force kill via power button.
Activity
alexxGmZ commentedon Sep 30, 2026
Based on my experience the memory leak happens only when the sidebar is open. If the sidebar is disabled, things are fine but the prompt box goes disappears unless the terminal is resized to it's state before the opencode is opened.
Terminal: kitty v0.49.1
opencode: v2.0.20
watch the topbar displaying my memory
opencode-memory-leak.mp4
RawEnchilada commentedon Oct 3, 2026
Yeah this makes opencode not usable at all for me. If i resize the terminal even by accident my computer will freeze and i have to force kill via power button.
simonklee commentedon Oct 3, 2026
This is fixed in v2.0.21