Skip to content

Bug: TUI hangs during startup with no MCP progress messages #7827

Closed

Description

@ivanmurashko

Symptoms

  • TUI appears to hang during startup when MCP servers are configured
  • No "Booting MCP server: {name}" progress messages displayed
  • Startup delay equals cumulative MCP server initialization time (~10-20 seconds at my case)
  • User sees blank screen with no feedback

Root Cause

The blocking call to notify_sandbox_state_change() in Session::new() (lines 651-660 in codex.rs)
waits for ALL MCP servers to fully initialize before returning. This prevents the TUI event loop
from starting, so McpStartupUpdateEvent messages are emitted but never consumed or displayed.

Impact

  • Poor user experience - app appears frozen during startup
  • No visibility into MCP initialization progress

Introduced In

Commit c6f68c9df (PR #7112) - "feat: declare server capability in shell-tool-mcp"

Fix

Move sandbox state notification into each MCP server's background init task, sending the
notification immediately after the server becomes Ready. This allows Session::new() to return
immediately while still ensuring servers receive sandbox state before handling tool calls.

Activity

  1. added
    bug
    CLI
    mcp
    TUI
    on Dec 10, 2025
  2. removed
    TUI
    on Dec 10, 2025
  3. added a commit that references this issue on Dec 12, 2025
    c978b6e
  4. added a commit that references this issue on Feb 20, 2026
    136c442
  5. added a commit that references this issue on Feb 27, 2026
    6e92948
  6. added a commit that references this issue on Jun 8, 2026
    c64d245
  7. added a commit that references this issue on Aug 7, 2026
    62fdeb6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIbugmcp

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions