Skip to content

[release/17.0] Fix MCP doctor timeout on Windows - #22213

Merged
Jose Perez Rodriguez (joperezr) merged 1 commit into
release/17.0from
backport-21882
Nov 13, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 1 commit into
release/17.0from
backport-21882

Conversation

@ellahathaway

Copy link
Copy Markdown
Contributor

Description

Backport of ##21882 to release/17.0

On Windows, the MCP doctor tool can time out while checking Aspire skills. Git inherits the MCP server's standard input pipe and can hang while the server is already reading from that pipe.

Git discovery commands now receive a null input handle instead of inheriting MCP's input. Output capture, cancellation, and existing fallback behavior remain unchanged. No new dependencies are required.

Testing

Added one Windows regression test that calls Git through a real stdio MCP server in an isolated child process.

  • Regression red/green: the new test times out without the fix and passes with it. It also passed three additional runs.
  • Git tests: all five tests passed with this command:
  • Actual MCP doctor: before the fix, the skills check hit its 30-second timeout. After the fix, it completed without that timeout. Direct JSON doctor also completed with exit code 0.

## Description

On Windows, the MCP `doctor` tool can time out while checking Aspire
skills. Git inherits the MCP server's standard input pipe and can hang
while the server is already reading from that pipe.

Git discovery commands now receive a null input handle instead of
inheriting MCP's input. Output capture, cancellation, and existing
fallback behavior remain unchanged. No new dependencies are required.

### Testing

Added one Windows regression test that calls Git through a real stdio
MCP server in an isolated child process.

- **Regression red/green:** the new test times out without the fix and
passes with it. It also passed three additional runs.
- **Git tests:** all five tests passed with this command:
- **Actual MCP doctor:** before the fix, the skills check hit its
30-second timeout. After the fix, it completed without that timeout.
Direct JSON doctor also completed with exit code 0.

Fixes #21877

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22213

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22213"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the Windows MCP timeout-fix backport.

No open issues 🎉

What changed in this PR

Backports the Windows MCP doctor timeout fix to release/17.0, preventing Git discovery commands from inheriting the MCP server’s standard input pipe.

Changes:

  • Gives Git a null standard input handle while preserving output capture and cancellation.
  • Adds a Windows regression test that invokes Git through a real stdio MCP server in an isolated child process.
File Description
tests/​Aspire.Cli.Tests/​Git/​GitRepositoryTests.cs Adds regression coverage for Git execution while MCP reads standard input.
src/​Aspire.Cli/​Git/​GitRepository.cs Supplies a null input handle to prevent Git from blocking on MCP’s input pipe.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

2 / 101 PR test projects · 4 PR jobs, from 2 changed files.

Selected PR test projects (2 / 101)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests

Selected PR jobs (4)

cli-starter-validation, extension-e2e, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

📦 affected project Aspire.Cli
→ 1 test: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.Tests/Git/GitRepositoryTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Cli
extension-e2e • src/Aspire.Cli/Git/GitRepository.cs
• affected project Aspire.Cli
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit d386302.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@joperezr
Jose Perez Rodriguez (joperezr) merged commit ade8549 into release/17.0 Nov 13, 2026
668 of 692 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Nov 13, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

excluded → base_branch_is_release, title_release_prefix. This is a backport (base release/17.0, title prefixed [release/17.0]); docs belong to the original PR. No signals triggered; the change is an internal Windows Git stdin fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants