TUI store leaks memory on session deletion and message removal #8562

Open
opened 2026-02-16 18:10:17 -05:00 by yindo · 1 comment
Owner

Originally created by @trvon on GitHub (Feb 4, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

session.deleted in sync.tsx only removes the session from store.session[] but leaves orphaned entries in message, part, todo, session_diff, session_status, permission, and question. Same pattern for message.removed leaving orphaned part data. Grows unboundedly over a long-running session.

Plugins

No response

OpenCode version

1.1.51

Steps to reproduce

Tests where included in PR

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @trvon on GitHub (Feb 4, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description `session.deleted` in `sync.tsx` only removes the session from `store.session[]` but leaves orphaned entries in `message`, `part`, `todo`, `session_diff`, `session_status`, `permission`, and `question`. Same pattern for `message.removed` leaving orphaned `part` data. Grows unboundedly over a long-running session. ### Plugins _No response_ ### OpenCode version 1.1.51 ### Steps to reproduce Tests where included in PR ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the bugperf labels 2026-02-16 18:10:17 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 4, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #10913: fix: multiple memory leaks in long-running sessions
  • #9140: Memory leak: Unbounded caches grow without limit
  • #5734: [FEATURE]: Subagent sessions accumulate without cleanup option - causes storage bloat and UI clutter
  • #11372: some session data are not cleaned up on unshare, leading to inconsistencies on reshare

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 4, 2026): This issue might be a duplicate of existing issues. Please check: - #10913: fix: multiple memory leaks in long-running sessions - #9140: Memory leak: Unbounded caches grow without limit - #5734: [FEATURE]: Subagent sessions accumulate without cleanup option - causes storage bloat and UI clutter - #11372: some session data are not cleaned up on unshare, leading to inconsistencies on reshare Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8562