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 stops applying all events after a message is removed in a session it never loaded #52584
An attached TUI can silently stop updating. Your prompts still send and the agent replies (both are saved server-side), but the transcript never shows them until you reopen the window.
Cause: every TUI client gets every session's events. The message.removed and message.part.removed handlers in packages/tui/src/context/sync.tsx index into store state without checking it exists. So a removal in a session this client never loaded throws: undefined is not an object (evaluating 'store.message[event.properties.sessionID].findIndex'). The throw escapes the SSE loop in context/sdk.tsx, whose .catch(() => {}) swallows it. The client stays connected but never applies another event.
Removals come from revert cleanup (the next prompt after /undo) and the delete message/part endpoints. So one /undo + resend in any session freezes every other open client that hadn't loaded that session.
Plugins
None needed to reproduce
OpenCode version
1.18.34, and current dev
Steps to reproduce
opencode serve, with sessions A and B that both already have messages
opencode attach <url> --session A
Delete a message in B that existed before step 2: DELETE /session/B/message/<id> (or /undo in B and send a new prompt)
Send anything in A. It's saved and answered, but the attached window never shows it
The v2 TUI safely handles undo cleanup for sessions it has not loaded. Its shared event store checks for missing session details and initializes message collections before applying removals, avoiding the exception that stopped subsequent updates. To get v2: npm i -g @opencode/cli@latest or curl -fsSL https://opencode.ai/v2/install | bash (desktop: update the app). If you still see this on v2, please open a new issue with the details.
Activity
github-actions commentedon Oct 1, 2026
This issue might be a duplicate of existing issues. Please check:
neriousy commentedon Oct 19, 2026
The v2 TUI safely handles undo cleanup for sessions it has not loaded. Its shared event store checks for missing session details and initializes message collections before applying removals, avoiding the exception that stopped subsequent updates. To get v2:
npm i -g @opencode/cli@latestorcurl -fsSL https://opencode.ai/v2/install | bash(desktop: update the app). If you still see this on v2, please open a new issue with the details.