Skip to content

Long-running MCP tool calls produce repeated progress indicator lines instead of updating in-place #1620

@m-nash

Description

@m-nash

Describe the bug

When an MCP tool call blocks for an extended period (e.g., a tool that waits for an external event before returning), the CLI's progress indicator produces repeated lines in the terminal instead of updating the existing line in-place.

○ my_long_running_tool
  ◉ Waiting for result (Esc to cancel · 55 B)

○ my_long_running_tool
  ∙ Waiting for result (Esc to cancel · 55 B)

○ my_long_running_tool
  ◎ Waiting for result (Esc to cancel · 55 B)

○ my_long_running_tool
  ◉ Waiting for result (Esc to cancel · 55 B)

○ my_long_running_tool
  ∙ Waiting for result (Esc to cancel · 55 B)

This repeats every few seconds and continues for the duration of the tool call, filling the screen with duplicate lines. The same behavior also occurs with read_agent(wait: true) calls on background agents, producing repeated "Waiting for result…" lines.

Steps to reproduce

  1. Create an MCP server with a tool that blocks for a long time (e.g., waits on a semaphore, external signal, or long timeout before returning)
  2. Configure the server in mcp.json with a long timeout:
    {
      "mcpServers": {
        "my-server": {
          "command": "my-server",
          "args": [],
          "timeout": 3600000
        }
      }
    }
  3. Have the agent call the blocking tool
  4. Observe the terminal — the progress indicator line is appended repeatedly instead of being updated in-place

Expected behavior

The progress indicator for a pending tool call should update the same line in the terminal (using ANSI cursor control), not append a new line on each spinner tick. A single long-running tool call should produce at most one visible progress line that animates its spinner character in-place.

Affected version

  • Copilot CLI version: 0.0.414
  • OS: Windows 11 (Windows Terminal)
  • MCP server timeout: configured at 3,600,000ms (1 hour)

Additional context

  • The timeout config in mcp.json is working correctly — the tool is NOT timing out or retrying
  • The spinner characters (, , ) cycle, suggesting it's the same animation intended to update one line
  • This makes patterns like "launch a background agent, block on MCP tool until it signals completion" impractical, since the main terminal fills with noise while waiting

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions