Repository navigation
[Perf] agentHost: isolate E2E storage on tmpfs - #340215
Merged
roblourens merged 8 commits intoOct 7, 2026
Merged
Conversation
Correlate restore, provider initialization, and database queue phases without changing deadlines, assertions, storage, or lifecycle ordering. Retain compact operation timings from successful hosts and sample Linux worker pressure outside the host processes. Add opt-in focused Linux replay and worker controls for measured CI comparisons. Co-authored-by: Copilot <[email protected]>
Run Linux CI replay on a private executable tmpfs while retaining required disk-backed persistence and lifecycle coverage. Keep real SQLite files, durability settings, close/reopen, deletion, and host restarts unchanged. Add same-worker alternating storage experiments, mount diagnostics, and cleanup regression coverage. Co-authored-by: Copilot <[email protected]>
Keep provider test workspaces outside the repository so ancestor instruction discovery cannot inject checkout AGENTS.md into strict replay. Allocate a unique /tmp mount and remove only that owned directory after unmounting. Preserve wrapper failure and cleanup coverage. Co-authored-by: Copilot <[email protected]>
Capture verified test-authoring guidance for instruction-safe temporary roots and separate RAM-backed semantics from required disk-backed lifecycle coverage. Co-authored-by: Copilot <[email protected]>
Keep Agent Host E2E runners, coverage, and Windows launch support under test/integration/agentHost. Share the scoped tmpfs wrapper with built-in Git extension tests, retaining required disk-backed commit, worktree, and symlink coverage and separate test reports. Update integration entrypoints and CI change detection, and cover both-pass failure propagation. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Filesystem-verification failures can pass silently, and incorrectly nested diagnostics tests leave the new behavior untested.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Reduces Linux integration-test storage latency using tmpfs while retaining required disk-backed lifecycle coverage.
Changes:
- Adds split-storage execution for Agent Host and Git integration tests.
- Adds operation timings, resource diagnostics, and storage-wrapper tests.
- Relocates Agent Host tooling and updates callers, CI controls, and documentation.
| File | Description |
|---|---|
test/integration/run-with-tmpfs.sh |
Adds private tmpfs setup and cleanup. |
test/integration/electron/git.sh |
Splits Git coverage across storage modes. |
test/integration/agentHost/runner.ts |
Adds storage passes and resource sampling. |
test/integration/agentHost/coverage.ts |
Updates relocated coverage tooling paths. |
test/integration/agentHost/child.ps1 |
Provides the relocated Windows launcher. |
src/vs/platform/files/test/node/integrationTestStorage.integrationTest.ts |
Tests storage isolation and failure propagation. |
src/vs/platform/agentHost/test/node/e2e/README.md |
Documents storage modes and diagnostics. |
src/vs/platform/agentHost/test/node/e2e/harness/agentHostE2ETestHarness.ts |
Enables trace logging and retains timings. |
src/vs/platform/agentHost/test/node/e2e/harness/agentHostE2EDiagnostics.ts |
Extracts operation logs across restarts. |
src/vs/platform/agentHost/test/node/agentHostOperationDiagnostics.test.ts |
Tests trace outcomes and correlation. |
src/vs/platform/agentHost/test/node/agentHostE2EDiagnostics.test.ts |
Adds operation-log retention tests. |
src/vs/platform/agentHost/node/sessionDataService.ts |
Passes logging into session databases. |
src/vs/platform/agentHost/node/sessionDatabase.ts |
Traces database operations and queues. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Traces session initialization phases. |
src/vs/platform/agentHost/node/copilot/copilotAgent.ts |
Traces resume and metadata persistence. |
src/vs/platform/agentHost/node/agentService.ts |
Traces restore and subscription phases. |
src/vs/platform/agentHost/node/agentHostOperationDiagnostics.ts |
Adds correlated operation timing. |
scripts/test-integration.sh |
Routes execution through new runners. |
scripts/test-integration.bat |
Updates the Agent Host runner path. |
package.json |
Updates test command paths. |
extensions/git/src/test/index.ts |
Labels reports by storage backing. |
build/azure-pipelines/product-smoke-flaky.yml |
Exposes Linux storage experiment controls. |
build/azure-pipelines/linux/product-smoke-flaky-linux.yml |
Supports focused and alternating runs. |
.github/skills/integration-tests/SKILL.md |
Documents Git storage options. |
.github/skills/agent-host-e2e-tests/SKILL.md |
Documents isolation and storage principles. |
.github/actions/detect-agent-host-e2e-changes/detect.ts |
Tracks relocated and shared infrastructure. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Remove the Git extension adoption, production timing instrumentation, and experimental flaky-pipeline controls. Keep storage tooling scoped to Agent Host E2E, require detached-worktree archive/restart/deletion coverage on disk, and fail on filesystem probe errors. Remove the out-of-scope review findings rather than carrying unrelated changes. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]> # Conflicts: # src/vs/platform/agentHost/test/node/e2e/README.md # test/integration/agentHost/runner.ts
Contributor
|
Base:
|
Update the Agent Host E2E startup fixture to copy and launch test/integration/agentHost tooling. Select disk mode explicitly so the Electron-preparation regression remains independent of CI tmpfs defaults. Co-authored-by: Copilot <[email protected]>
roblourens
marked this pull request as ready for review
October 7, 2026 06:09
Giuseppe Cianci (Giuspepe)
approved these changes
Oct 7, 2026
roblourens
deleted the
roblou/agents/troubleshoot-flaky-tests-logs-3e979ea2
branch
October 7, 2026 15:03
roblourens
added a commit
that referenced
this pull request
Oct 8, 2026
<!-- Thank you for submitting a Pull Request. Please: * Read our Pull Request guidelines: https://github.com/microsoft/vscode/wiki/How-to-Contribute#pull-requests * Associate an issue with the Pull Request. * Ensure that the code is up-to-date with the `main` branch. * Include a description of the proposed changes and how to test them. --> Follow-up to #340215, addressing shared Agent Host E2E instability rather than changing individual product contracts. ### Changes - Canonicalize 125 temporary directory allocations across the Agent Host E2E suites and harness. Native realpath resolves Windows short/long names and macOS aliases before paths enter provider configuration, prompts, and AHP assertions. Cleanup ownership is unchanged; canonicalization failures remove the just-allocated empty directory and report errors. - Share the exact-chat/turn completion and subsequent unread barrier between executable snapshot rounds and imperative resumed-turn scenarios. Earlier outcomes cannot complete another round of the same turn. Errors and strict replay failures remain failures. - Regenerate one resumed-turn AHP snapshot to retain the post-completion unread action. - Disable both Git automatic garbage collection and modern auto-maintenance in all test repositories, including bare remotes, clones, and MCP workspaces, to prevent unrelated background processes retaining Windows handles at teardown. Clone-time maintenance is disabled before clone executes; clones retain their existing author identity. - Add harness regression coverage for directory aliases, Windows short paths, allocation/canonicalization/cleanup errors, and bare/clone Git maintenance configuration; update the E2E reference. No production or pipeline changes, timeout increases, retries, new skips of existing scenarios, weakened assertions, or model-fixture edits. The Windows-only regression is skipped on other platforms and on volumes that do not provide 8.3 aliases. ### Validation - `npm run build-fast -- --client-only` — passed. - `npm run typecheck-client` — passed. - `(git diff --name-only --diff-filter=ACM -z -- '*.ts'; git ls-files --others --exclude-standard -z -- '*.ts') | xargs -0 npm run eslint --` — passed for all 40 changed TypeScript files before commit; corrected helper/test files rechecked after final edits. - `./scripts/test.sh --run src/vs/platform/agentHost/test/node/ahpSnapshot.test.ts --run src/vs/platform/agentHost/test/node/agentHostTestDirectories.test.ts --run src/vs/platform/agentHost/test/node/agentHostE2EServerLease.test.ts --reporter dot` — final revision: 21 passed; Windows-only regression pending on macOS. - `./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/e2e/conformance/agentHostConformance.integrationTest.ts --reporter dot` — 368 passed, 15 existing pending. - `./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/e2e/providers/copilotAgentHostE2E.integrationTest.ts --run src/vs/platform/agentHost/test/node/e2e/providers/claudeAgentHostE2E.integrationTest.ts --reporter dot` — 390 passed, 62 existing pending. - `./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/e2e/providers/copilotAgentHostE2E.integrationTest.ts --run src/vs/platform/agentHost/test/node/e2e/providers/claudeAgentHostE2E.integrationTest.ts --grep 'resumes a failed turn in place|resumes the same turn after repeated failures|client tool reaches ready|workspace conversion:|provider checkpoints: historical|archiving a never-restored' --reporter dot` — final focused replay passed, 10 tests. - `./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/e2e/conformance/agentHostConformance.integrationTest.ts --run src/vs/platform/agentHost/test/node/e2e/providers/copilotAgentHostE2E.integrationTest.ts --grep 'branch completions prioritize the default|archiving a detached worktree removes|remote.*commit|fetch.*remote|pull.*remote|runtime mcp' --reporter dot` — final review revision passed, 3 tests. - `./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/e2e/conformance/agentHostConformance.integrationTest.ts --run src/vs/platform/agentHost/test/node/e2e/providers/copilotAgentHostE2E.integrationTest.ts --grep 'runtime MCP:|sync pulls a non-conflicting remote commit|sync pushes an outgoing commit' --reporter dot` — final review revision passed, 6 tests. - `git diff --check` and commit hygiene — passed. The full local conformance/provider runs preceded the final native-realpath adapter and auto-maintenance addition; focused harness/provider tests and type checks passed after those edits. Packaged cross-platform validation is required before merge. A selected local Codex checkpoint test was blocked by a macOS `sandbox-exec` execution refusal. No sandbox controls were bypassed. Azure will validate the packaged provider path. Two independent definition-111 CI builds validate Windows, Linux, and macOS without publishing or release: - [481908](https://dev.azure.com/monacotools/Monaco/_build/results?buildId=481908) — Windows/Linux/macOS Electron integration tasks passed at `6148019506a5`; Windows E2E suite completed in 465.6 seconds. - [481909](https://dev.azure.com/monacotools/Monaco/_build/results?buildId=481909) — Windows/Linux/macOS Electron integration tasks passed at `6148019506a5`; Windows E2E suite completed in 447.9 seconds. GitHub [37703368889](https://github.com/microsoft/vscode/actions/runs/37703368889) passed Compile & Hygiene and all three platform Electron integration jobs. Its Windows unit failures were defects in the new regression tests: an expected path used legacy rather than native realpath, and cmd quoting produced an invalid path. Commit `e826c7476a0a` corrects only the unit-test file; E2E harness and scenario inputs are unchanged, so their successful validation is retained. On [37707649062](https://github.com/microsoft/vscode/actions/runs/37707649062), all three platform Electron integration jobs and Windows Electron-Unit passed. The Windows short-path and aliased-parent regressions explicitly passed in both Electron and Node.js test runners, not skipped. The Azure Linux/macOS smoke failures selecting the model context option `1M` reproduce verbatim on unchanged main [481889](https://dev.azure.com/monacotools/Monaco/_build/results?buildId=481889). They are outside this PR's Agent Host E2E scope; no UI or smoke tests were changed. On `e826c7476a0a`, GitHub Compile & Hygiene's native type check completed with zero errors, but the full-repository ESLint process was killed with exit 137 without a reported lint violation. Windows Electron-Smoke failed during WSL preparation because `apt-get install` segfaulted (exit 139), before smoke tests ran. Attempt 2 retries only these two verified infrastructure-failed jobs without code changes. Required CI checks remain in force. The earlier runs 481904/481905 and GitHub 37701928554 were canceled as superseded before these review corrections. Compile & Hygiene had passed on the earlier GitHub revision; this is not counted as final-revision validation. (Written by Copilot)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Isolate Agent Host E2E tests only from physical-storage latency while retaining required disk-backed lifecycle coverage.
test/integration/agentHost; update package commands, integration entrypoints, and CI change detection.No Git extension changes, production-code changes, or flaky-pipeline YAML changes are included. No deadlines, replay fixtures, assertions, SQLite durability settings, or product lifecycle ordering are changed. Tmpfs is not machine-crash durability coverage; the disk-backed pass remains required.
Evidence
Related Linux lifecycle failures: 480990 and 481414.
Temporary diagnostic builds showed multi-second storage operations coinciding with substantial I/O pressure. 481449 alternated four disk and four tmpfs runs of an unchanged Agent Host workload on the same Linux worker; all eight passed:
The investigation's production timing instrumentation and experimental pipeline controls are not part of this PR. These measurements demonstrate a material storage-latency contribution, not proof that every original timeout is resolved.
Validation
npm run transpile-client— passed after merging currentmain.VSCODE_SKIP_PRELAUNCH=1 ./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/agentHostStorage.integrationTest.ts— 7 passed after the merge (six wrapper cases plus registry-cleanliness validation).VSCODE_SKIP_PRELAUNCH=1 npm run test-agent-host-e2e -- --storage disk --jobs 6 --grep 'session metadata history and provider context survive a host restart|archiving a never-restored session survives a host restart|a created automation survives an agent host restart|automation lifecycle: cancelled request deduplication survives a restart|automation lifecycle: an unavailable model produces a durable failed run|regression coverage: cold resume retains ordered user and assistant context|regression coverage: identical prompts remain separate completed turns after resume|detached worktree safety:'— 18 passed before the upstream merge, including the additional Agent Host worktree coverage.npm run eslint -- test/integration/agentHost/runner.ts test/integration/agentHost/coverage.ts src/vs/platform/agentHost/test/node/agentHostStorage.integrationTest.ts .github/actions/detect-agent-host-e2e-changes/detect.ts— passed.node build/hygiene.ts test/integration/agentHost/runner.ts test/integration/agentHost/coverage.ts test/integration/agentHost/tmpfs.sh test/integration/agentHost/child.ps1 src/vs/platform/agentHost/test/node/agentHostStorage.integrationTest.ts— passed.bash -n test/integration/agentHost/tmpfs.sh— passed.node --test build/lib/testAgentHostE2EStartup.test.ts build/lib/electronVersion.test.ts— 7 passed. The upstream Agent Host startup fixture now uses the relocated runner/Windows launcher and explicitly selects disk mode; this fixes the old-pathENOENTreported by Compile & Hygiene.npm run typecheck-client— passed before the upstream merge; the post-merge local check is blocked by the installed older@microsoft/mxc-sdklacking the/v1declarations required by currentmain. Fresh CI installs from the merged lockfile.Earlier packaged validations:
481510 and 481511 both passed at the current revision, with successful Electron integration tasks on Linux, Windows, and macOS in each run. They validate the narrowed scope, expanded Agent Host disk selection, upstream merge, and corrected startup fixture.
In each accepted Linux build, all six Agent Host entrypoints passed on tmpfs (947 reported tests, approximately 254 seconds), followed by all 18 required disk-backed lifecycle tests (31–36 seconds). The three detached-worktree cases passed on both backings.
The GitHub Code OSS workflow passed at the current revision, including Compile & Hygiene and Linux/macOS/Windows Electron integration. Its isolated Linux unit-check rerun passed without code changes.
How to test
On Linux with noninteractive mount privileges:
Use
--storage diskor--storage tmpfsfor an explicit control, and--grepto select Agent Host scenarios. Split mode always runs the required disk-backed lifecycle selection, independent of the broad-pass filter.(Written by Copilot)