Skip to content

Disable idle session eviction in agent host - #323824

Merged
roblourens merged 2 commits into
mainfrom
roblou/disable-idle-session-eviction
Jul 1, 2026
Merged

roblourens merged 2 commits into
mainfrom
roblou/disable-idle-session-eviction

Conversation

@roblourens

Copy link
Copy Markdown
Member

Idle-session eviction in _maybeEvictIdleSession is 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)

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]>
Copilot AI review requested due to automatic review settings July 1, 2026 03:38

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.

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 _maybeEvictIdleSession eviction path in AgentService.
  • Updated AgentService unit 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
roblourens marked this pull request as ready for review July 1, 2026 03:45
@roblourens
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]>
@roblourens

Copy link
Copy Markdown
Member Author

Addressed Copilot review comments:

  • Updated JSDoc to reflect the no-op behavior.
  • Added void resource to mark the parameter intentionally unused.
  • Added a TODO noting the need to re-enable eviction or add an LRU cap.
  • Renamed the multi-subscriber test to match its new assertion.

(Written by Copilot)

@roblourens
roblourens merged commit bc8df25 into main Jul 1, 2026
29 checks passed
@roblourens
roblourens deleted the roblou/disable-idle-session-eviction branch July 1, 2026 06:50
@vs-code-engineering vs-code-engineering Bot added this to the 1.128.0 milestone Jul 1, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Aug 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants