Repository navigation
agentHost: Synchronize session read state from chats - #339732
Merged
Sandeep Somavarapu (sandy081) merged 4 commits intoOct 5, 2026
Merged
Sandeep Somavarapu (sandy081) merged 4 commits into
Sandeep Somavarapu (sandy081) merged 4 commits into
Conversation
Dispatch the session-level read action whenever a participating chat changes the effective aggregate, while leaving hidden and tool chats independent. Co-authored-by: Copilot <[email protected]>
Move aggregate read-state authority to Agent Host so clients only dispatch chat changes. Promote the session when the last participating unread chat becomes read, while preserving explicitly unread sessions on redundant chat updates. Co-authored-by: Copilot <[email protected]>
Keep session aggregate synchronization as an Agent Host implementation detail without changing the existing protocol action contract. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation matches the stated aggregation rules and includes focused coverage for transitions, exclusions, and persistence.
Review effort: Balanced
Findings: None
What changed in this PR
Synchronizes Agent Host session read state with participating chats while preserving explicit unread state.
Changes:
- Promotes sessions when the final unread participating chat becomes read.
- Excludes hidden and tool chats from aggregation.
- Adds state, persistence, and multi-chat tests plus documentation.
| File | Description |
|---|---|
AGENT_HOST_SESSIONS_PROVIDER.md |
Documents read-state synchronization. |
agentService.test.ts |
Tests multi-chat behavior and persistence. |
agentHostStateManager.test.ts |
Covers aggregation and redundant actions. |
agentHostStateManager.ts |
Implements bidirectional read-state synchronization. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Dmitriy Vasyura (dmitrivMS)
previously approved these changes
Oct 5, 2026
Apply an explicit session read action before synchronizing its sole chat so the chat transition does not recursively promote and persist the same session state twice. Co-authored-by: Copilot <[email protected]>
Benjamin Christopher Simmonds (benibenj)
approved these changes
Oct 5, 2026
Sandeep Somavarapu (sandy081)
deleted the
sandy081/agents/sync-session-read-aggregate
branch
October 5, 2026 12:56
This was referenced Oct 25, 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 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.
What Changed
Why
When a completed turn marked both the chat and session unread, viewing the chat only marked the chat read. The session could therefore remain unread and become visibly unread again after a later session-list refresh. Agent Host owns the complete chat catalog, so it now performs the aggregate transition authoritatively instead of relying on the client.
Testing
npm run compile— passednpm run hygiene— passed./scripts/test.sh --run src/vs/platform/agentHost/test/node/agentHostStateManager.test.ts --run src/vs/platform/agentHost/test/node/agentService.test.ts --grep "marking a chat unread|marking the sole unread chat read|only the last unread aggregate chat|keeps the session unread when another chat is unread|promotes and persists the session when the last unread chat becomes read"— 5 passing