Skip to content

fix(mcp): an mcp tool stops at its timeout, also when its command runs in-process #1356

Closed

Description

@dan-petty

Problem

This is a Copilot thread on release PR #1283, verified at b57ef7f. MCP tools pass a timeout to _run_mcp_cmd; ci_run, for example, uses the CI test budget plus its margin [code: src/devops_cli/ai/mcp/server.py:676]. A uv run devops ... command is routed to InProcessDispatcher.dispatch, which runs it in-process through _dispatch_typer and never applies the timeout [code: src/devops_cli/ai/mcp/dispatcher.py:291-335]. A hung in-process command therefore blocks the tool indefinitely. The same path exists on main (v0.2.27), so it predates this release.

Acceptance criteria

  • Every MCP tool stops at its timeout. A command that must be bounded runs where it can be stopped, such as a subprocess through the process runner, or an in-process run with an enforced deadline that returns a timeout error naming the tool.
  • A test with a command that never returns shows the tool returning a timeout error within its budget.
  • uv run devops ci passes.

Strategic alignment

Activity

  1. added
    type/bug
    scope/mcp
    priority/p2-medium
    on Oct 7, 2026
  2. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Priority: P2-Medium. A hung in-process command blocks the MCP tool indefinitely, but the condition requires a command to actually hang, making it a reliability defect rather than a constant failure.
    • Value: Medium. MCP tool users lose all responsiveness when a command hangs, but most invocations complete normally so the impact is situational.
    • Effort: Medium. Requires implementing an enforced deadline in the in-process dispatch path (threading or async timeout), returning a structured timeout error, and adding a test with a never-returning command.
  3. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Linked: #997, whose generated tools run through the dispatcher this item bounds (ai/mcp/dispatcher.py:335-367). Found by the 2026-10-08 backlog review.

  4. added 2 commits that reference this issue on Oct 26, 2026
    b95a4ce
    22e4712
  5. added a commit that references this issue on Oct 26, 2026
    6cf8ff0
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

    priority/p2-mediumscope/mcptype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions