Repository navigation
chat: sync queued agent host messages - #315130
Merged
Merged
Conversation
Ensures agent host sessions keep chat-model pending requests synchronized when an existing session is restored while a turn is already active. - Starts pending-message sync for restored agent-host sessions, including when the chat model is created after session content is provided. - Treats same-id steering and queued pending-message text changes as protocol upserts so edited pending requests are sent to the backend. - Adds regression coverage for restored active sessions and queued pending-message text updates. Fixes #314824 (Commit message generated by Copilot)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes agent-host session restore behavior so chat-model pending (queued/steering) requests stay synchronized with the agent host protocol state when restoring a session that already has an active turn.
Changes:
- Start pending-message synchronization for restored agent-host sessions (including when the chat model is created after session content is provided).
- Treat same-id steering and queued pending-message text changes as upserts so edited pending requests are re-sent to the backend.
- Add regression tests for restored active sessions and queued pending-message text updates.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts | Wires pending-message sync on restore, treats text updates as upserts, and subscribes to model creation when needed. |
| src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts | Adds tests covering restored active sessions and queued pending-message text update synchronization. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 2
| // --- Steering --- | ||
| if (currentSteering) { | ||
| if (currentSteering.id !== prevSteering?.id) { | ||
| if (currentSteering.id !== prevSteering?.id || currentSteering.text !== prevSteering.userMessage.text) { |
Comment on lines
+2391
to
+2398
|
|
||
| this._pendingMessageSubscriptions.set(sessionResource, this._chatService.onDidCreateModel(model => { | ||
| if (!isEqual(model.sessionResource, sessionResource)) { | ||
| return; | ||
| } | ||
| this._pendingMessageSubscriptions.deleteAndDispose(sessionResource); | ||
| this._ensurePendingMessageSubscription(sessionResource, backendSession); | ||
| })); |
roblourens
approved these changes
May 8, 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.
chat: sync queued agent host messages
Ensures agent host sessions keep chat-model pending requests synchronized when an existing session is restored while a turn is already active.
Fixes #314824
(Commit message generated by Copilot)