Fix Rust AppHost run-session notification routing - #19831
Adam Ratzman (adamint) merged 2 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c0d661ed-8b37-4959-b365-e29b3e8911e2
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c0d661ed-8b37-4959-b365-e29b3e8911e2
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19831Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19831" |
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: None
What changed in this PR
Prevents Rust AppHost adapter lifecycle events from corrupting DCP run sessions.
Changes:
- Separates AppHost lifecycle events from resource notifications.
- Rejects empty run-session IDs at the DCP boundary.
- Adds focused regression tests.
| File | Description |
|---|---|
extension/src/debugger/adapterTracker.ts |
Suppresses DCP lifecycle notifications for AppHosts. |
extension/src/dcp/AspireDcpServer.ts |
Drops and logs notifications with empty session IDs. |
extension/src/test/adapterTracker.test.ts |
Tests AppHost lifecycle routing. |
extension/src/test/aspireDcpServer.test.ts |
Tests empty-ID rejection before delivery. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Ella Hathaway (ellahathaway)
left a comment
There was a problem hiding this comment.
I reviewed the AppHost-versus-resource adapter routing, DCP run-session lifecycle and wire-delivery paths, Rust adapter behavior, shutdown/restart/telemetry ownership, and focused regression coverage.
I found no correctness issues. I left one nonblocking maintainability note about removing a delivery method made unreachable by this change.
Description
Rust AppHosts launched through CodeLLDB or cppvsdbg could send an empty run-session ID to DCP before the real Rust resource started. DCP rejected that notification and recycled the shared connection, which could leave the resource at PID 0 with no logs or proxy while the adapter-owned process kept running.
This keeps AppHost adapter events on the AppHost lifecycle path instead of reporting them as resource events. It also rejects empty run-session IDs at the extension's DCP boundary so another producer cannot send the same invalid payload.
The Rust
NoDebuglaunch path remains unchanged. We still use the configured adapter to launch the AppHost; we just no longer treat that AppHost child as a DCP resource run.Validation:
main.Fixes #19750
Checklist
<remarks />and<code />elements on your triple slash comments?