Skip to content

Preserve active peer chats during idle eviction - #331112

Open
Ulugbek Abdullaev (ulugbekna) wants to merge 2 commits into
mainfrom
ulugbekna/fix-active-peer-chat-eviction
Open

Preserve active peer chats during idle eviction#331112
Ulugbek Abdullaev (ulugbekna) wants to merge 2 commits into
mainfrom
ulugbekna/fix-active-peer-chat-eviction

Conversation

@ulugbekna

Copy link
Copy Markdown
Contributor

Fixes #331111

Agent Host idle eviction currently checks only the default chat's denormalized activeTurn. An active peer chat can therefore lose its host-side state when the parent session has no subscribers, even though the provider continues running.

This change:

  • uses the session-wide active-turn tracker at every idle-release checkpoint
  • keeps an unsubscribed session cached while any catalog chat is active
  • adds regression coverage for an active peer chat surviving the release grace period

Tests:

  • ./scripts/test.sh --run src/vs/platform/agentHost/test/node/agentService.test.ts --grep "subscriber refcount eviction"

Use the session-wide active-turn tracker when deciding whether an unsubscribed session can be released, so peer chat turns keep their host state alive.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ea077bee-57a9-4f08-8c14-a8778fbcea83

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

Preserves active peer-chat state during Agent Host idle eviction.

Changes:

  • Uses session-wide active-turn tracking at eviction checkpoints.
  • Adds peer-chat eviction regression coverage.
Show a summary per file
File Description
agentService.ts Guards idle eviction against any active chat.
agentService.test.ts Tests active peer-chat retention.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread src/vs/platform/agentHost/node/agentService.ts Outdated
Re-arm idle release when a peer chat becomes active while session data is draining, and cover eviction after that turn completes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ea077bee-57a9-4f08-8c14-a8778fbcea83
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent Host evicts an active peer chat after its parent session is unsubscribed

2 participants