Skip to content

[do not review] Fix stale AppHost running state after debug session ends#17965

Draft
ellahathaway wants to merge 1 commit into
microsoft:mainfrom
ellahathaway:ellahathaway/fix-apphost-stale-running-state
Draft

[do not review] Fix stale AppHost running state after debug session ends#17965
ellahathaway wants to merge 1 commit into
microsoft:mainfrom
ellahathaway:ellahathaway/fix-apphost-stale-running-state

Conversation

@ellahathaway
Copy link
Copy Markdown
Contributor

Summary

The VS Code Aspire extension kept showing an AppHost as "running" in its tree view after the user stopped an F5 debug session.

Root cause

aspire ps --follow reports a stopped event only as an incremental delta. When a debug session ends the AppHost is hard-killed, so the live follow stream never emits its stopped delta and keeps reporting the AppHost as running. A fresh one-shot aspire ps snapshot is authoritative (the AppHost is gone), but nothing triggered one on debug stop.

Fix

  • Seed the global ps polling with an authoritative one-shot aspire ps snapshot, then attach the --follow stream, so the repository reconciles to ground truth on every (re)start.
  • Route debug-stop through the existing stopping lifecycle: on debug-session end the AppHost is marked stopping (spinner) and the ps stream is restarted, replacing the stale follow with a fresh authoritative snapshot that reconciles the stopped AppHost out of the tree.
  • Reduce tree re-render churn by restarting only the ps stream on debug stop instead of doing a full workspace rediscovery.

Testing

  • yarn run compile-tests, yarn run compile, yarn run lint all green.
  • Unit test updates for the seed-then-follow reordering are still in progress.

Draft while remaining unit test work is finished.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 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 -- 17965

Or

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

@adamint
Copy link
Copy Markdown
Member

adamint commented Jun 5, 2026

ensure there is an e2e test here @ellahathaway - have an agent check it fails before the fix

@ellahathaway ellahathaway changed the title Fix stale AppHost running state after debug session ends [do not review] Fix stale AppHost running state after debug session ends Jun 5, 2026
@ellahathaway ellahathaway force-pushed the ellahathaway/fix-apphost-stale-running-state branch from 64c4b42 to 3438db3 Compare June 5, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants