Skip to content

Concurrent MCP new_tab creations can leave a tab whose shell never starts (empty pane, no prompt) #327

Description

@kshivang

Summary

Found while stress-testing PR #326. When two MCP calls that create tabs run concurrently (e.g. two show_image calls with panel: "new_tab" issued from two SSE sessions at the same time), one or both of the created tabs can end up permanently dead: the pane renders empty, the shell never prints its first prompt, and content injected via dataStream never appears in the buffer.

Repro

  1. Open two MCP SSE sessions to the same BossTerm instance.
  2. From both simultaneously, call show_image with panel: "new_tab" (any image).
  3. Both calls return ok: true with distinct tabIds.
  4. read_scrollback on the new tabs returns zero non-blank lines — no shell prompt, no injected caption — and re-checking minutes later shows the same. Sequential calls (even back-to-back with no delay) work fine; 8/8 in the same test session.

Observations

  • The tab exists in list_tabs and shows in the sidebar; its buffer is just permanently empty.
  • Since even the OSC payload appended to dataStream never materializes, the session's PTY/emulator pipeline appears never to have started — pointing at a race in tab/session creation or PTY init when two creations interleave, not at rendering.
  • Possibly related in spirit to the plugin-restore race fixed in BossConsole#821 (async init vs. use).

Environment

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions