Skip to content

Fix TUI dropping live chat when resumable grid is hidden#445

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-correctness-bugs-53f9
Draft

Fix TUI dropping live chat when resumable grid is hidden#445
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-correctness-bugs-53f9

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 30, 2026

Bug and impact

After the TUI grid parity pass (#444), multiView (grid exists) was decoupled from gridViewActive (grid is shown). Users can build a multi-tile grid, then open or create a single chat while the grid stays resumable in the background.

Impact: Live chat events for the active single-chat session were silently dropped — frozen transcript, no streaming spinner, and missing tool-approval prompts (agent workflows could stall with no UI surface). Summary-only refresh still ran, so the bug looked like a stuck/frozen chat rather than a hard crash.

Trigger: Create a 2+ tile grid, then open a different chat from the drawer or start a new chat (grid hidden, multiView retained). Send a message and observe no live tokens/approvals until a full history hydrate.

Root cause

onChatEvent built openSessionIds from multiView.tiles whenever multiView was non-null, ignoring gridViewActive. Submit/scroll/selection already gated on gridViewActiveRef; the event subscription did not.

Fix

  • Add resolveOpenChatSessionIds() in multiChatLayout.ts (grid visible → tile ids; otherwise → active session only).
  • Use it in the onChatEvent subscription in app.tsx.

Validation

  • npx vitest run src/tuiClient/__tests__/multiChatLayout.test.ts (8 tests, including 3 new cases)

Related open PRs (not duplicated)

Open in Web View Automation 

The grid parity pass decoupled multiView from gridViewActive so a grid can
stay resumable while the user chats in a single session. onChatEvent still
keyed open sessions only on multiView tile ids, so live tokens, streaming
state, and approval prompts were dropped for the active non-tile chat.

Co-authored-by: Arul Sharma <arul28@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ade Ignored Ignored May 30, 2026 2:04pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant