Enhance session customization handling and simplify sync logic#317700
Open
DonJayamanne wants to merge 3 commits into
Open
Enhance session customization handling and simplify sync logic#317700DonJayamanne wants to merge 3 commits into
DonJayamanne wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves how agent-host session customizations are surfaced and synchronized so that custom agents/customizations are available immediately when a session is created or restored (not only after the first message), and refactors parts of the sync flow to be clearer and more deterministic.
Changes:
- Claim the active client earlier on session restore so the host can sync this client’s customizations into session state immediately.
- Forward
SessionStatesnapshots for “NewSession” into the provider’s cached state so the agent picker can see custom agents before the first message. - Ensure Copilot session customizations are read from a “settled” view (wait for initial discovery/sync), and publish initial customizations right after
createSession.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts | Updates tests to reflect the new “active client claimed on restore” behavior. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts | Claims active client during session restore to unblock customization-derived agents on open. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts | Adds coverage ensuring NewSession state forwarding populates picker custom agents pre-send and cleans up on dispose. |
| src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts | Implements NewSession state forwarding into _lastSessionStates + cleanup sentinel; avoids duplicate writers on graduation. |
| src/vs/platform/agentHost/node/copilot/copilotAgent.ts | Adds “settled” customization snapshotting to avoid empty results during initial discovery/sync. |
| src/vs/platform/agentHost/node/agentService.ts | Publishes initial session customizations after state creation so subscribers see custom agents immediately. |
Copilot's findings
- Files reviewed: 6/6 changed files
- Comments generated: 1
Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com>
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.
Improve session customization management and state synchronization across agents. This update ensures that customizations are immediately available upon session creation, enhancing user experience. Additionally, refactor the synchronization logic for better clarity and efficiency.