Repository navigation
sessions: reuse worktree cleanup measurements - #341814
Merged
Megan Rogge (meganrogge) merged 1 commit intoOct 15, 2026
Merged
Conversation
Keep valid disk-usage results when cleanup archives sessions, and share the foreground measurement progress across concurrent editor loads. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No actionable defects remain; focused regression coverage supports the changes, though tests were not rerun during this review.
0 open findings
What changed in this PR
Improves Agents Window worktree cleanup by reusing disk measurements while recomputing session eligibility.
Changes:
- Preserves cached measurements after archive and cleanup.
- Shares foreground progress across concurrent editor loads.
- Adds regression coverage for measurement reuse and shared progress.
| File | Description |
|---|---|
| src/vs/sessions/contrib/sessionInputBanners/test/browser/sessionWorktreeCleanupService.test.ts | Tests post-cleanup reuse and concurrent loads. |
| src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupService.ts | Preserves measurements and coalesces foreground progress. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Vritant Bhardwaj (vritant24)
approved these changes
Oct 15, 2026
Megan Rogge (meganrogge)
deleted the
agents/fix-agents-window-worktree-cleanup
branch
October 15, 2026 17:32
2 tasks done
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.
Fixes Agents Window worktree cleanup measurement reuse:
When measurement occurs
Completed disk-usage results are cached in memory for one hour and keyed by the sorted set of session IDs and worktree URIs. Eligibility state (archived, active, running, pinned, recent, and the selected inactivity period) is recomputed whenever results are consumed; changing eligibility does not by itself require another disk measurement.
Manually opening Worktree Cleanup
Automatic cleanup suggestion scan
Validation
npm run build-fast -- --client-only— passed./scripts/test.sh --run src/vs/sessions/contrib/sessionInputBanners/test/browser/sessionWorktreeCleanupService.test.ts— passed (24 tests)./node_modules/.bin/eslint src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupService.ts src/vs/sessions/contrib/sessionInputBanners/test/browser/sessionWorktreeCleanupService.test.ts— passednpm run typecheck-client— passedgit diff --check— passedFixes #341816