Skip to content

Fix VS Code debug startup with older Aspire CLI - #19447

Draft
Ella Hathaway (ellahathaway) wants to merge 1 commit into
mainfrom
ellahathaway-fix-vscode-hosting-startup
Draft

Fix VS Code debug startup with older Aspire CLI#19447
Ella Hathaway (ellahathaway) wants to merge 1 commit into
mainfrom
ellahathaway-fix-vscode-hosting-startup

Conversation

@ellahathaway

Copy link
Copy Markdown
Contributor

Description

VS Code debug launches can fail with Hosting failed to start when a newer Aspire extension invokes Aspire CLI 13.3.5 and AppHost startup takes longer than 60 seconds. That CLI reads the legacy ASPIRE_CLI_BACKCHANNEL_CONNECT_TIMEOUT_SECONDS setting and does not use the newer startup timeout for its backchannel deadline.

This change makes extension-managed debug launches provide both the current and legacy timeout settings from the effective startup timeout after launch environment overrides are merged. Explicit values remain authoritative, including differently cased environment keys on Windows, and the existing redacted spawn diagnostic now reports both effective timeout values. Run-without-debugging and ordinary terminal launches remain unchanged.

User-facing usage

No configuration is required. Debugging an Aspire app in VS Code can now tolerate AppHost startup beyond the legacy 60-second backchannel deadline when an older CLI is on PATH.

Validation

  • 98 focused extension unit tests
  • Targeted 65-second startup Extension Host E2E with the packaged current CLI
  • Targeted 65-second startup Extension Host E2E with the official Aspire CLI 13.3.5 Windows ARM64 build
  • TypeScript compilation and linting

Fixes #17354

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Configure both current and legacy Aspire CLI startup timeouts for extension-managed debug launches while preserving explicit overrides.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e2652344-3792-442b-885f-f3cddca21a0e
Copilot AI balanced review requested due to automatic review settings August 17, 2026 19:55
@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 -- 19447

Or

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

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector (audit mode)

The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement.

0 / 101 test projects · 2 jobs, from 8 changed files.

Selected test projects (0 / 101)

none — no .NET test projects run for this change.

Selected jobs (2)

extension-e2e, extension-unit


How these were chosen — grouped by what changed

Job reasons

Job Triggered by
extension-e2e extension/scripts/run-e2e.js, extension/src/test-e2e/debugStartupTimeout.e2e.test.ts, extension/src/test-e2e/helpers/fixtures.ts, extension/src/test/aspireTerminalProvider.test.ts, extension/src/test/cliSpawn.test.ts, extension/src/utils/AspireTerminalProvider.ts, extension/src/utils/environment.ts, extension/src/utils/process/cliProcess.ts
extension-unit extension/scripts/run-e2e.js, extension/src/test-e2e/debugStartupTimeout.e2e.test.ts, extension/src/test-e2e/helpers/fixtures.ts, extension/src/test/aspireTerminalProvider.test.ts, extension/src/test/cliSpawn.test.ts, extension/src/utils/AspireTerminalProvider.ts, extension/src/utils/environment.ts, extension/src/utils/process/cliProcess.ts

Selection computed for commit 600058d.

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.

Pull request overview

Ensures VS Code debug sessions remain compatible with older Aspire CLIs by propagating the effective startup timeout to the legacy backchannel timeout.

Changes:

  • Adds legacy timeout configuration after launch-environment merging.
  • Preserves explicit and case-insensitive Windows overrides.
  • Adds unit and E2E regression coverage for delayed startup.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
extension/src/utils/process/cliProcess.ts Configures and logs both timeout values.
extension/src/utils/environment.ts Centralizes debug timeout derivation.
extension/src/utils/AspireTerminalProvider.ts Defers timeout defaults where launch overrides apply.
extension/src/test/cliSpawn.test.ts Tests timeout merging and diagnostics.
extension/src/test/aspireTerminalProvider.test.ts Tests defaults and explicit overrides.
extension/src/test-e2e/helpers/fixtures.ts Adds a legacy-timeout CLI wrapper.
extension/src/test-e2e/debugStartupTimeout.e2e.test.ts Verifies startup beyond 60 seconds.
extension/scripts/run-e2e.js Supports older SDK fixtures and workspace URI launching.

test('derives the legacy backchannel timeout after merging the launch environment', () => {
const childProcess = createTestChildProcess(4646);
const spawnStub = sinon.stub(nodeChildProcess, 'spawn').returns(childProcess);
const terminalProvider = { createEnvironment: () => ({}) } as AspireTerminalProvider;
@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.

@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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hosting failed to start inside VS Code dev container with quickstart

2 participants