Repository navigation
Disable idle session eviction in agent host - #323824
Merged
Merged
Conversation
Idle-session eviction in `_maybeEvictIdleSession` is causing issues where cached session state is dropped while clients still expect it to be observable. Disable the eviction path for now while we investigate, and update the related tests to expect state to remain cached after the last subscriber drops. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR disables idle-session eviction in the agent host to prevent cached session state from being dropped while clients still expect it to remain observable, and updates unit tests to reflect that the session state stays cached after the last subscriber unsubscribes.
Changes:
- Disabled the
_maybeEvictIdleSessioneviction path inAgentService. - Updated
AgentServiceunit tests to assert that restored session state remains cached after subscribers drop.
Show a summary per file
| File | Description |
|---|---|
| src/vs/platform/agentHost/node/agentService.ts | Disables idle-session eviction (currently early-returning in _maybeEvictIdleSession). |
| src/vs/platform/agentHost/test/node/agentService.test.ts | Updates eviction-related tests to expect cached session state to remain after unsubscribe while eviction is disabled. |
Review details
Comments suppressed due to low confidence (1)
src/vs/platform/agentHost/node/agentService.ts:1222
- The eviction implementation is currently left in a large commented-out block. This tends to rot (imports get removed, types change) and makes it harder to re-enable safely. Prefer keeping the code live behind an explicit boolean/feature flag (so it continues to typecheck) or removing it entirely and relying on git history to recover it later.
/*
const key = resource.toString();
if (this._resourceSubscribers.has(resource)) {
return;
}
- Files reviewed: 2/2 changed files
- Comments generated: 4
- Review effort level: Low
roblourens
marked this pull request as ready for review
July 1, 2026 03:45
roblourens
enabled auto-merge (squash)
July 1, 2026 03:45
- Update `_maybeEvictIdleSession` JSDoc to reflect the no-op behavior. - Add `void resource` to mark the parameter intentionally unused. - Add a TODO noting the need to re-enable eviction or add an LRU cap. - Rename the multi-subscriber test to match its new assertion. Co-authored-by: Copilot <[email protected]>
Member
Author
|
Addressed Copilot review comments:
(Written by Copilot) |
Christof Marti (chrmarti)
approved these changes
Jul 1, 2026
This was referenced Jul 3, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Idle-session eviction in
_maybeEvictIdleSessionis causing issues where cached session state is dropped while clients still expect it to be observable. This change disables the eviction path for now while we investigate, and updates the related tests to expect state to remain cached after the last subscriber drops.(Written by Copilot)