Skip to content

Improve visibility of long-running / externally-blocked MCP tool calls #2079

@aheritier

Description

@aheritier

Problem

When an MCP server (e.g. IntelliJ) blocks a tool call waiting for user confirmation on its side, docker-agent shows only an indefinite spinner (⟳ Working...). The user has no way to know:

  • How long the tool call has been running
  • That an external application needs attention
  • What to do about it

This was observed with IntelliJ's MCP server blocking on execute_terminal_command confirmation while the docker-agent TUI appeared stuck indefinitely.

Screenshots

The TUI shows a tool call spinner with no duration or hint that IntelliJ needs attention:

Screenshot 2026-03-12 at 11 29 11
Screenshot 2026-03-12 at 11 29 47

Proposed Improvements

1. Elapsed time on running tool calls (low effort)

Add a StartedAt timestamp to tool call messages and render elapsed time next to the spinner:

⟳ Run tools with Javascript (2m15s)

Makes stuck calls immediately obvious.

2. Long-running tool call warning (low effort)

After a configurable threshold (e.g. 60s), display a warning in the TUI:

⚠ Tool call has been running for over 60s. The MCP server may be waiting for external input. Check the MCP server application for pending confirmations. Press Esc to cancel.

3. Configurable MCP tool call timeout (medium effort)

Wire the existing Toolset.Timeout config field (currently only used by fetch) to MCP CallTool via context.WithTimeout. Default could be ~5 minutes. On timeout, return a clear error message so the model can retry or switch tools.

Relevant Code Paths

  • pkg/tools/mcp/mcp.gocallTool() has no timeout, blocks indefinitely on ts.mcpClient.CallTool(ctx, request)
  • pkg/tui/types/types.goMessage struct has no StartedAt field
  • pkg/tui/components/toolcommon/common.goIcon() / RenderTool() show spinner with no duration
  • pkg/config/latest/types.goToolset.Timeout exists but is only wired for fetch

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/toolsFor features/issues/fixes related to the usage of built-in and MCP toolsarea/tuiFor features/issues/fixes related to the TUIkind/enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions