Skip to content

agentHost: retain complete E2E snapshot failure diagnostics - #340449

Merged
roblourens merged 2 commits into
mainfrom
roblou/agents/e2e-snapshot-diagnostics
Oct 9, 2026
Merged

roblourens merged 2 commits into
mainfrom
roblou/agents/e2e-snapshot-diagnostics

Conversation

@roblourens

@roblourens roblourens commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #340395 from the recurring Agent Host E2E stability audit.

Why

Large prompt and AHP snapshot mismatches frequently produce [mocha] output truncated to 8192 characters. The existing snapshot helper writes the full .actual next to the source baseline, outside the uploaded logs artifact. This makes it difficult to distinguish intentional SDK contract changes, bad fixtures, and real ordering/context regressions after CI finishes.

For example, Azure 481969 reported 19 prompt snapshot mismatches per failing platform with truncated diffs. These are discovery evidence, not a claim that each mismatch is a flake or test defect.

Changes

  • Wrap the shared AHP snapshot comparisons and Copilot prompt comparison with E2E-only diagnostic retention.
  • Preserve complete, already-normalized expected and actual strings under .build/logs/integration-tests/agent-host-e2e-snapshots-<pid>/, which existing CI log uploads include.
  • Rethrow the original mismatch unchanged. A diagnostic write failure reports both errors instead of masking the assertion.
  • Passing comparisons and unrelated failures produce no artifacts. Later passing comparisons do not remove retained failure evidence.
  • Keep source baselines, comparison semantics, replay strictness, update modes, timeouts, and gates unchanged. No production or pipeline changes and no model-fixture edits.

Validation

Current head 49de1a0cb294 includes the merged recovery mitigation #340421 and checkpoint correctness fix #340634. Main was merged without rewriting the existing PR history. The net PR remains five diagnostics-only files; no production change is added by this PR.

  • Client output was refreshed with the repository's applyIncrementalClientChanges helper from the previous compiled head to the signed merge. No shared dependency installation or modification.
  • env -u COPILOT_HOME VSCODE_SKIP_PRELAUNCH=1 ./scripts/test.sh --run src/vs/platform/agentHost/test/node/agentHostE2EDiagnostics.test.ts --run src/vs/platform/agentHost/test/node/ahpSnapshot.test.ts --run src/vs/platform/agentHost/test/node/agentHostE2EServerLease.test.ts --reporter dot — 23 passed. Includes a real SnapshotContext mismatch, complete comparisons larger than the reporter threshold, unchanged baselines, success/unrelated-error behavior, retained evidence after a subsequent pass, and diagnostic write failures.
  • env -u COPILOT_HOME VSCODE_SKIP_PRELAUNCH=1 ./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/e2e/providers/copilotPromptsE2E.integrationTest.ts --run src/vs/platform/agentHost/test/node/e2e/providers/copilotAgentHostE2E.integrationTest.ts --grep 'Agent Host E2E — Copilot prompts|provider errors:|resumes a failed turn in place|client tool reaches ready after start and completes|retains context across consecutive turns' --reporter dot — 28 passed in strict replay, including all four error/recovery scenarios.
  • npm run typecheck-client — passed.
  • npm run eslint -- src/vs/platform/agentHost/test/node/agentHostE2EDiagnostics.test.ts src/vs/platform/agentHost/test/node/e2e/harness/agentHostE2EDiagnostics.ts src/vs/platform/agentHost/test/node/e2e/harness/ahpSnapshot.ts src/vs/platform/agentHost/test/node/e2e/providers/copilotPromptsE2E.integrationTest.ts — passed.
  • git diff --check and signed commit hygiene — passed.

GitHub 37875797631 passed Compile & Hygiene and all three Electron integration jobs at the refreshed head. Its only failed job was Linux Electron-Smoke: Starts a session in a Dev Container timed out waiting for the visible Starting Dev Container preparation text. The failure log and full UI diagnostics artifact are preserved; the diagnostics-only E2E wrapper is not used by that UI smoke test. Only that smoke job is being rerun, without code changes, higher timeouts, or assertion changes. The UI failure's root cause remains unclassified.

Packaged Windows x64/Linux x64/macOS ARM64 Azure 482581 is running at the same head. Publishing and release are disabled. The PR remains draft pending validation and maintainer review; auto-merge is not enabled.

Earlier CI evidence

Packaged Windows/Linux/macOS Electron integration validation passed in Azure 482095. The overall build failed in the separate Linux Unit Tests job's Mixin vscode-capi preparation: npm ci reported ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC before those tests ran.

GitHub 37739694012 passed the unit jobs and macOS/Windows Electron integration jobs. Two failures are preserved explicitly:

  • Compile & Hygiene: full-repository ESLint was killed with exit 137, without a reported lint violation. Its isolated retry passed on attempt 2 without code changes.
  • Linux Electron: the pre-existing Copilot recovery test returned an empty response instead of RECOVERED. The host log shows a pending recovery send, stale idle at 06:55:42.103, and Turn changed during preparation; dropping send at .154. This was a real product race, not a snapshot mismatch or a diagnostic-wrapper failure. Its separately merged fix fix(agentHost): ignore the failed execution's idle in the next Copilot turn #340421 is included in the refreshed head. No assertions, timeouts, or gates were changed to hide it.

(Written by Copilot)

Keep full normalized prompt and AHP snapshot comparisons in uploaded integration logs when CI truncates the reporter diff. Preserve the original assertion and report artifact failures without masking it.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 8, 2026 06:48

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

Electron IPC drops nested AggregateError details, so diagnostic-write failures conceal both underlying errors in CI output.

0 open findings

What changed in this PR

Retains complete Agent Host E2E snapshot mismatch diagnostics in CI artifacts.

Changes:

  • Adds diagnostic retention for AHP and Copilot prompt snapshots.
  • Adds regression coverage and troubleshooting documentation.
File Description
e2e/​README.md Documents retained snapshot diagnostics.
copilotPromptsE2E.integrationTest.ts Wraps prompt comparisons.
harness/​ahpSnapshot.ts Wraps AHP comparisons.
harness/​agentHostE2EDiagnostics.ts Persists expected and actual output.
agentHostE2EDiagnostics.test.ts Tests retention and failure behavior.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 1bcc86ee Current: 8cfcc559

Changed (1)

sessions/chatCompositeBar/MixedStatuses/Light
Before After
before after

@roblourens
roblourens marked this pull request as ready for review October 9, 2026 03:12
@roblourens
roblourens enabled auto-merge (squash) October 9, 2026 03:12
@roblourens
roblourens merged commit e8e9139 into main Oct 9, 2026
82 of 83 checks passed
@roblourens
roblourens deleted the roblou/agents/e2e-snapshot-diagnostics branch October 9, 2026 03:34
@vs-code-engineering vs-code-engineering Bot added this to the 1.142.0 milestone Oct 9, 2026
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.

3 participants