feat: Implement changeset state caching and management in AgentHost#318096
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors expanded changeset state retention out of AgentHostStateManager into a dedicated AgentHostChangesetStateCache with a soft LRU policy, and reshapes persisted-changeset handling so the session list overlay parses metadata without forcing live state to be seeded for every row.
Changes:
- Adds
AgentHostChangesetStateCache(silent LRU, soft limit 500) and routes all changeset state access inAgentHostStateManagerthrough it. AgentServicesupplies subscriber/compute-awarecanEvictand callsonChangesetLivenessChangedon unsubscribe;AgentHostChangesetServicetracks_activeStaticComputesand pings liveness on completion/failure.- Splits
restorePersistedStaticChangesetsintoparsePersistedStaticChangesets+applyPersistedStaticChangesets;ChangesetSessionCoordinator.decorateListEntrynow only parses (does not seed) for the list overlay.
Show a summary per file
| File | Description |
|---|---|
| src/vs/platform/agentHost/node/agentHostChangesetStateCache.ts | New LRU-style soft-limit cache with canEvict hook and silent eviction. |
| src/vs/platform/agentHost/node/agentHostStateManager.ts | Delegates changeset state storage to the cache; adds onChangesetLivenessChanged and constructor options. |
| src/vs/platform/agentHost/node/agentHostChangesetService.ts | Adds parse/apply split, isStaticChangesetComputeActive, and active-compute tracking around _doComputeStaticChangeset. |
| src/vs/platform/agentHost/node/agentHostChangesetCoordinator.ts | List overlay now calls parsePersistedStaticChangesets instead of restore (no state seeding). |
| src/vs/platform/agentHost/node/agentService.ts | Wires canEvict to subscriber/subagent/active-compute checks; notifies liveness on unsubscribe. |
| src/vs/platform/agentHost/test/node/agentHostChangesetService.test.ts | Adds parse/apply and LRU eviction test coverage. |
| src/vs/platform/agentHost/test/node/agentSideEffects.test.ts | Updates FakeChangesetService with new no-op methods. |
Copilot's findings
- Files reviewed: 7/7 changed files
- Comments generated: 1
…clarify handling of non-changeset URIs
…nge notifications
dmitrivMS
approved these changes
May 25, 2026
dileepyavan
pushed a commit
that referenced
this pull request
May 27, 2026
…318096) * feat: Implement changeset state caching and management in AgentHost * Fixes * fix: Update restoreSessionIfChangesetSubscription to return void and clarify handling of non-changeset URIs * refactor: Simplify changeset eviction logic and improve comments for clarity * feat: Add releaseBranchChanges method and enhance session summary change notifications
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.
Problem today
listSessionswill build the state for the session+added -deletedFix
listSessionswill build the state for the session+added -deleted