Skip to content

Forward VS Code debug output to dashboard logs, apphost errors show in Aspire debug session console#16512

Open
adamint wants to merge 4 commits intomicrosoft:mainfrom
adamint:dev/adamint/issue16468-vite-dashboard-logs
Open

Forward VS Code debug output to dashboard logs, apphost errors show in Aspire debug session console#16512
adamint wants to merge 4 commits intomicrosoft:mainfrom
adamint:dev/adamint/issue16468-vite-dashboard-logs

Conversation

@adamint
Copy link
Copy Markdown
Member

@adamint adamint commented Apr 28, 2026

Description

Forward non-telemetry VS Code debug adapter output events to DCP service logs so output shown in the VS Code Debug Console also appears in Aspire Dashboard console logs.

This fixes JavaScript resource logs by launching Node resources through VS Code js-debug's pwa-node adapter with outputCapture: "std", which is required for package-manager and Vite stdout/stderr to be emitted as Debug Adapter Protocol output events. The tracker forwards those output events to DCP as serviceLogs.

This also incorporates and supersedes the AppHost startup failure reporting from #16516. This is because pwa-node tracking would also be required to get ts AppHost stderr. AppHost failures that happen before the child debug session starts now write details to the Debug Console as stderr instead of only showing a dialog. Build failures whose output was already streamed are not replayed a second time, and AppHost child debug output is mirrored back to the parent Aspire Debug Console so TypeScript AppHost runtime/startup errors are visible in the same place as C# AppHost errors.

Fixes #16468
Fixes #15578

Validation:

  • npm run compile-tests
  • npm run unit-test -- --grep "Node Debugger Tests|Debug Adapter Tracker Tests|failed AppHost start"

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
  • Does the change require an update in our Aspire docs?

Forward non-telemetry debug adapter output events from VS Code resource sessions to DCP service logs so JavaScript/Vite output that appears in the Debug Console also appears in the Aspire Dashboard.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 28, 2026 06:24
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 28, 2026

🚀 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 -- 16512

Or

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the VS Code extension’s debug integration by forwarding non-telemetry Debug Adapter Protocol (DAP) output events to the DCP service logs, so that Node/Vite output visible in the VS Code Debug Console also appears in the Aspire Dashboard logs for JavaScript resources launched under VS Code debugging.

Changes:

  • Forward all non-telemetry DAP output events (not just stdout/stderr) to DCP as serviceLogs.
  • Add unit coverage validating that non-telemetry categories are forwarded and telemetry output is ignored.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
extension/src/debugger/adapterTracker.ts Broadened forwarding logic to send non-telemetry debug adapter output events as DCP serviceLogs.
extension/src/test/adapterTracker.test.ts Added tests ensuring non-telemetry output events are forwarded (with correct stderr mapping) and telemetry output is excluded.

@adamint adamint changed the title Forward VS Code debug output to dashboard logs Forward VS Code debug output to dashboard logs, apphost errors show in Aspire debug session console Apr 29, 2026
@adamint
Copy link
Copy Markdown
Member Author

adamint commented Apr 29, 2026

I confirmed the following 4 cases work:

  • c# OR ts apphost w/build error shows that build error in the aspire debug session
  • c# OR ts apphost w/node apps have console logs appear in the aspire dashboard

@adamint adamint marked this pull request as ready for review April 29, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants