Skip to content

Ignore inspection requests aborted by the resource attach proof's own continue - #21911

Merged
Adam Ratzman (adamint) merged 3 commits into
mainfrom
aspireagent/resource-attach-proof-resume-aborted-inspection
Nov 25, 2026
Merged

Adam Ratzman (adamint) merged 3 commits into
mainfrom
aspireagent/resource-attach-proof-resume-aborted-inspection

Conversation

@davidfowl

@davidfowl David Fowler (davidfowl) commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Description

What failed: Aspire resource debug language model tool E2E attaches packaged .NET and Go debuggers, hits breakpoints, detaches, and tears down (VS Code extension E2E, Windows resource-debug-tools) failed on main in run 41932442823 with a failed variables response, 'Evaluation aborted.' (request_seq 13), in proof.debugAdapterResponses. All four failing jobs (listed below) show the same signature: VS Code's variables request on e2e-custom-output-worker failing with 'Evaluation aborted.'. Every rerun passed.

Why: when the attach proof stops at its breakpoint, VS Code's Variables/Call Stack views inspect the stopped frame. The proof then resumes with its own customRequest('continue'), which bypasses VS Code's thread model. vsdbg aborts the inspection requests still in flight. The failing job's diagnostics had no DAP request trace, so this ordering is inferred from request_seq, not traced. The harness counted these as adapter failures, so the test failed even though attach, the breakpoint, detach and teardown all worked.

Fix: a small tracker (extension/src/testing/resumeInterruptedInspectionRequests.ts) watches the attach proof's DAP stream. The proof arms it immediately before sending its own continue to the attached session. A failed stackTrace/scopes/variables/evaluate response is classified as resume-interrupted only if its request was still pending when the adapter received that continue (the observed #21777 case), or was sent after it and before the next stopped event (defensive; no CI run has shown this yet). Those responses move to a separate resumeInterruptedInspectionResponses array. Each entry records why it was classified (pendingAtProofContinue or sentAfterProofContinue) and the proof continue's request seq. The proof returns this array on success, and the resource-debug E2E logs it when it is nonempty, so a passing run shows when the exemption fired. Every other failure stays in debugAdapterResponses, and the test's deepStrictEqual(..., []) assertion is unchanged. This includes inspection failures while the thread is still stopped, failures after a later stop, non-inspection failures such as continue/setBreakpoints, failures in other sessions, and failures after any continue the proof did not send.

Fixes #21777
Refs #21411 (the original resource-debug-tools issue; it has since been retitled to track a different Java failure)

Confidence

  • New unit suite resumeInterruptedInspectionRequests.test.ts replays the DAP sequence from the failing job, asserts the recorded classification for each ignored response, and covers the edge cases that must still be reported.
  • Before/after: with the classifier disabled (onResponse always returns false), 2/7 tests fail: the CI variables "Evaluation aborted." sequence and the defensive post-continue scopes sequence. With the fix, 7/7 pass. With the proof-continue gating removed, the "continue the proof did not send" case fails. The existing attachedResourceDetachSequence suite (5 tests) also passes.
  • tsc -p . and tsc -p tsconfig.e2e.json compile; eslint on the changed files is clean.
  • Not run locally: the real VS Code resource-debug-tools E2E (needs Windows + vsdbg) and the full vscode-test unit run. CI covers both. The failing job's diagnostics had no DAP request trace, so the exact request ordering comes from the response (request_seq 13/15, before the proof's continue), not from a trace. The new classification logging will show the ordering directly if the exemption fires in CI.

How we stop this recurring: the proof now distinguishes between failures its own resume causes and real adapter failures, so new VS Code view requests at a stop can't make the proof fail again.

Failure stats (14d, attempt 1)

CI workflow on microsoft/aspire, runs created 2026-10-25 06:28 → 2026-11-08 06:28 UTC, attempt 1 only. Denominator: attempt-1 jobs that ran (success or failure). Hits: the failed job's log matches the signature. Jobs that lost their runner, which have no log, are excluded. Main runs have no reruns, so their flake check is the next main run of the job.

Signature attaches packaged .NET and Go debuggers… failing debugAdapterResponses with variables → Evaluation aborted.
Job VS Code extension E2E (Windows, resource-debug-tools)
main pushes: hits / runs 2 / 118 (1.69%)
PR runs: hits / runs 2 / 614 (0.33%); 0 PR-caused excluded
Combined rate 4 / 732 = 0.55%
Main rate, 14d / 30d 2 / 118 (1.69%) / 2 / 118 (1.69%). The job first ran on main on 2026-10-29, so the 30d window holds the same runs
Rerun-pass count 4 / 4 hits passed on rerun (PR) or on the next main run (main)
Unclassifiable 3 main failures (2026-10-30, 11-01, 11-02) have expired logs (404). They count in the denominator but not as hits
Flake check main: next main run of the job passed 2/2; PR: 2/2 rerun hits passed on rerun (0 never rerun)
First / last hit 2026-11-03 / 2026-11-06
Still hitting main? Last main hit: 2026-11-04. 12 main runs since the last hit (2026-11-06), with 0 hits
Local before / after DAP-replay unit suite: 5/7 pass before (2/7 fail) → 7/7 pass after (no real E2E repro)
This PR's CI Earlier head ea0992e2: CI green (Final Results pass); the Windows resource-debug-tools job passed 2/2 attempts there (plus 3/3 on an earlier commit). Current head: see checks

Failing runs (all 4 hits, same excerpt in each log: AssertionError: Expected values to be strictly deep-equal → { command: 'variables', message: 'Evaluation aborted.' }):

Verdict: MODERATE. A real but rare flake: 4 hits, 2 of them on main, and every one passed on rerun or on the next main run. The fix is checked only by replaying the DAP sequence. The PR's own E2E runs (5) are too few to show a change at a 0.55% rate.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
  • Did you add public API?
    • No
  • Does the change make any security assumptions or guarantees?
    • No

🤖 Posted by AspireAgent (AI Agent)

… continue

VS Code's Variables view inspects the stopped frame while the attach proof
resumes the debuggee with a custom continue request. vsdbg then fails the
in-flight request with 'Evaluation aborted.', which the proof reported as an
adapter failure. Track stackTrace/scopes/variables/evaluate requests that were
pending when the adapter received the proof's continue (or sent before the next
stop) and keep their failures out of debugAdapterResponses; they are still
returned as resumeInterruptedInspectionResponses for diagnostics.

Fixes #21777
Refs #21411

Co-authored-by: Copilot <[email protected]>
@davidfowl David Fowler (davidfowl) added the agent:working An AI agent is actively working on this issue or PR label Nov 8, 2026 — with Copilot SWE Agent
@github-actions

github-actions Bot commented Nov 8, 2026

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 -- 21911

Or

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

@github-actions

This comment has been minimized.

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.

🟡 Changes recommended

The wildcard tracker can hide unrelated sessions’ inspection failures, so classification must be scoped to the attached session’s proof-triggered continue and covered by a cross-session regression test.

1 open issue
What changed in this PR

This PR addresses #21777 by separating inspection failures associated with debugger resume from other adapter failures in the VS Code resource-attach E2E proof.

Changes:

  • Adds per-session tracking of inspection requests pending at resume or sent before the next stop.
  • Records classified failures in separate diagnostics while preserving the existing failure assertion.
  • Adds six unit tests covering request ordering, subsequent stops, non-inspection failures, and session isolation.
File Description
extension/​src/​testing/​resumeInterruptedInspectionRequests.ts Tracks inspection requests and classifies resume-interrupted failures.
extension/​src/​testing/​e2eStateFileBridge.ts Integrates tracking and records separate diagnostics.
extension/​src/​test/​resumeInterruptedInspectionRequests.test.ts Tests classification and failures that must remain reported.

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 8, 2026

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

github-actions Bot commented Nov 8, 2026

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.

Arm the tracker for the attached session immediately before the proof sends
continue, so a continue from any other session or caller cannot hide failures.

Co-authored-by: Copilot <[email protected]>
@github-actions

This comment has been minimized.

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

No active review issues were identified for the change separating resume-interrupted inspection requests from other debug adapter failures.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 8, 2026

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.

@davidfowl
David Fowler (davidfowl) marked this pull request as ready for review November 8, 2026 06:54
@davidfowl David Fowler (davidfowl) removed the agent:working An AI agent is actively working on this issue or PR label Nov 8, 2026
@davidfowl David Fowler (davidfowl) added the agent:working An AI agent is actively working on this issue or PR label Nov 8, 2026 — with Copilot SWE Agent
@davidfowl David Fowler (davidfowl) removed the agent:working An AI agent is actively working on this issue or PR label Nov 8, 2026

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.

I reviewed the attach proof's detach sequence, the new interrupted-inspection classifier and its wiring in the E2E bridge, the unit tests, and the four failed runs behind #21777. Every failure is the same Variables request on the custom-output worker failing with 'Evaluation aborted.' after the proof's own continue. I don't think this hides a product failure: the proof still checks attach, breakpoint binding, the continue, both resource responses, detach, and termination, and the exemption only covers inspection requests in the proof's resume window. I left 2 nonblocking notes, one on a cited failure mode the runs don't show and one on making the exemption visible so the inferred ordering can be confirmed.

@davidfowl David Fowler (davidfowl) added the agent:working An AI agent is actively working on this issue or PR label Nov 10, 2026 — with Copilot SWE Agent

David Fowler (davidfowl) commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator Author

AspireAgent stopped: both review threads are answered and CI is green; waiting on re-review.

🤖 Posted by AspireAgent (AI Agent)

The resume classifier now returns why it ignored a failed inspection
response (pending at the proof's continue, or sent after it) and that
continue's request seq. The bridge stores this on each entry in
resumeInterruptedInspectionResponses, and the resource-debug E2E logs
the array when it is nonempty, so a passing run shows when the
exemption fired.

The post-continue case is described as defensive: every observed
failure (#21777) is a pending variables request failing with
'Evaluation aborted.'.

Co-authored-by: Copilot <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

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

Selected PR test projects (0 / 101)

none — no PR-gated .NET test projects run for this change.

Selected PR jobs (2)

extension-e2e, extension-unit


How these were chosen — grouped by what changed

Job reasons

Job Triggered by
extension-e2e extension/src/test-e2e/resourceDebugTools.e2e.test.ts, extension/src/test/resumeInterruptedInspectionRequests.test.ts, extension/src/testing/e2eStateFileBridge.ts, extension/src/testing/resumeInterruptedInspectionRequests.ts
extension-unit extension/src/test-e2e/resourceDebugTools.e2e.test.ts, extension/src/test/resumeInterruptedInspectionRequests.test.ts, extension/src/testing/e2eStateFileBridge.ts, extension/src/testing/resumeInterruptedInspectionRequests.ts

Selection computed for commit 1e3d026.

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

4 open issues

Review effort: Lite

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

@davidfowl David Fowler (davidfowl) removed the agent:working An AI agent is actively working on this issue or PR label Nov 10, 2026
David Fowler (davidfowl) added a commit that referenced this pull request Nov 10, 2026
#21938)

## Description

**What failed:** `[vscode] Aspire Blazor browser debugger E2E > hits a
managed breakpoint for hosted-global` in **VS Code extension E2E
(Windows, browser-debugger)**, on main in run
[42413925421](https://github.com/microsoft/aspire/actions/runs/42413925421)
([job](https://github.com/microsoft/aspire/actions/runs/42413925421/job/128531739772))
and on a PR branch in run
[42312596518](https://github.com/microsoft/aspire/actions/runs/42312596518)
([job](https://github.com/microsoft/aspire/actions/runs/42312596518/job/128225566096)).
The test reported only the masked bridge error `Failed to apply E2E
control revision …: E2E control command failed.`

**Why:** `hosted-global` is the only Blazor scenario that uses
`closeMode: 'natural'`. The proof continues the breakpoint, asks
js-debug for its CDP proxy and sends `Page.close` over that socket. The
js-debug traces in both failing runs' diagnostics artifacts
(`blazor-debugadapter-*.json`, `proxyActivity`) show the page target
detaching before the browser answered. js-debug v1.117.0's
`CDPSession._onClose`
([connection.ts#L385-L388](https://github.com/microsoft/vscode-js-debug/blob/v1.117.0/src/cdp/connection.ts#L385-L388))
rejects the pending call with `setCause(0, 'Connection is closed')`, and
the proxy (`sendOrDie`) relays it to the client as
`{"id":1,"error":{"code":0,"message":"Connection is closed"}}`, keeping
the proxy socket open. Passing runs get `{"id":1,"result":{}}`.
`closeBrowserPageThroughCdp` already accepted a socket *close* after
`Page.close` as "target gone", but treated this equivalent error reply
as `Browser CDP Page.close failed`, which fails the proof even though
the page, Mono and root sessions then terminate normally (they do in
both traces).

**Fix:** `closeBrowserPageThroughCdp` now treats the js-debug
target-closed reply (`code === 0 && message === 'Connection is closed'`)
the same as the socket-close case. This doesn't weaken the proof: the
caller still requires every proof session (root, browser, managed) to
terminate and `debug-in-browser` to return to `Enabled`. Any other
`Page.close` error (e.g. `-32601 Method not found`) still fails.

**Regression tests** (`extension/src/test/e2eStateFileBridge.test.ts`,
run against the real `executeE2eControlCommand` product path):
- `accepts target disconnection (target-closed reply) during Page.close
only after all proof sessions terminate`: the CI failure, which fails
without the fix with the exact CI error `Browser CDP Page.close failed:
{"code":0,"message":"Connection is closed"}`.
- `rejects a target-closed Page.close reply while a proof session
remains active`: shows the reply is not a bypass, because the proof
still fails if the managed session stays alive.
- The existing socket-close case is kept, parametrized alongside the new
one.

Dedupe: no open issue or PR covers `hosted-global`.
#21912 covers a different browser-debugger failure (the
`maps managed Edge debugging` before-all hook CLI `--version` probe),
and none of the AspireAgent PRs #21911–#21932 touch this test. Tracker:
#21600.

## Confidence

Paired local runs of `e2eStateFileBridge.test.js` under VS Code 1.131.0
(`vscode-test`, xvfb), same machine and commit, toggling only the
product change:

| | runs green | per-run result |
|---|---|---|
| before (fix reverted, new tests kept) | **0/10** | 61 passing, 2
failing (the two new tests, with the CI error) |
| after | **10/10** | 63 passing, 0 failing |

`yarn lint` and `yarn compile-tests` pass. This is a test-harness change
only (`extension/src/testing`), so there's no product behavior change
and no E2E behavior evidence beyond the CI `browser-debugger` shards on
this PR.

## Failure stats (14d, attempt 1)

Window 2026-10-25 12:00 → 2026-11-08 12:00 UTC, `ci.yml`, attempt-1 jobs
only. The denominator is decided attempt-1 runs (same definition as
#21600). Hits are verified from each failed `VS Code extension E2E
(Windows, browser-debugger)` job's mocha failure line (48 failed jobs
scanned over 30d).

- **This signature** (`hits a managed breakpoint for hosted-global` →
`Page.close` target-closed reply): **3/1157** decided runs, **2 main / 1
PR** (main 2/160, PR 1/997).
- **Any `hosted-global` failure:** 4/1157. The extra one (run
40728167754) is a different cause, `Timed out after 300000ms waiting for
browser navigation to 'counter'`, which this PR does **not** claim to
fix.
- **30d main:** **2** verified hits (both are in the 14d window). Six
older or other main browser-debugger failures had expired or unavailable
logs and could not be classified.
- The two newest failures show only the masked `E2E control command
failed.`; the js-debug traces in their diagnostics artifacts show the
`{"code":0,"message":"Connection is closed"}` proxy reply. The 10-28
main failure predates the masking and prints the exact error.

| Run | Date (UTC) | Branch | Job | Error |
|---|---|---|---|---|
|
[42413925421](https://github.com/microsoft/aspire/actions/runs/42413925421)
| 11-07 21:02 | main |
[128531739772](https://github.com/microsoft/aspire/actions/runs/42413925421/job/128531739772)
| masked; trace shows target-closed reply |
|
[42312596518](https://github.com/microsoft/aspire/actions/runs/42312596518)
| 11-06 23:32 | PR (eerhardt-dashboard-authorize-anonymous-pages) |
[128225566096](https://github.com/microsoft/aspire/actions/runs/42312596518/job/128225566096)
| masked; trace shows target-closed reply |
|
[40606196498](https://github.com/microsoft/aspire/actions/runs/40606196498)
| 10-28 00:02 | main |
[122561450397](https://github.com/microsoft/aspire/actions/runs/40606196498/job/122561450397)
| `Browser CDP Page.close failed: {"code":0,"message":"Connection is
closed"}` |
|
[40728167754](https://github.com/microsoft/aspire/actions/runs/40728167754)
| 10-28 16:39 | PR (native-bundle-continuation) |
[122971965889](https://github.com/microsoft/aspire/actions/runs/40728167754/job/122971965889)
| different cause: navigation timeout (not addressed) |

## Verdict

**STRONG**: the failure was reproduced deterministically through the
product code path, and the before-fix run fails with the exact CI error
string (0/10 → 10/10). js-debug traces from both recent failures and the
unmasked 10-28 main error point to the same cause. The frequency is low
(3/1157), so CI alone will take time to confirm the absence of hits.

This PR's own CI (head `bbb5a79f`) was green on both `browser-debugger`
shards on attempt 1. The attempt-1 rerun was only for the unrelated
`tree-actions` flake (#21796, fix in #21914).

**How we stop this recurring:** CDP proxy transport outcomes after
`Page.close` (socket close *or* js-debug's target-closed reply) are now
classified in one place, `isCdpProxyTargetClosedError`, with unit tests
pinning both forms. The proof's real gate stays session termination plus
command reset, so future js-debug transport variations can't silently
mask a real leak.

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] Yes
  - [ ] No
- Did you add public API?
  - [ ] Yes
  - [x] No
- Does the change make any security assumptions or guarantees?
  - [ ] Yes
  - [x] No

**🤖 Posted by AspireAgent (AI Agent)**

Co-authored-by: davidfowl <[email protected]>
Co-authored-by: Copilot <[email protected]>
@davidfowl David Fowler (davidfowl) added the agent:working An AI agent is actively working on this issue or PR label Nov 10, 2026 — with Copilot SWE Agent

David Fowler (davidfowl) commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator Author

AspireAgent stopped: it answered and resolved all four review threads without code changes, and Final Results is green.

🤖 Posted by AspireAgent (AI Agent)

@adamint
Adam Ratzman (adamint) merged commit e7bd735 into main Nov 25, 2026
187 of 190 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.1 milestone Nov 25, 2026
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.

[CI Failure] Flaky: VS Code resource debug E2E gets failed 'variables' response 'Evaluation aborted.'

4 participants