Skip to content

agentHost: fix bugs around message handling#311054

Merged
connor4312 merged 2 commits intomainfrom
connor4312/ah-messaging
Apr 17, 2026
Merged

agentHost: fix bugs around message handling#311054
connor4312 merged 2 commits intomainfrom
connor4312/ah-messaging

Conversation

@connor4312
Copy link
Copy Markdown
Member

  • Fix a bug where a sessions were not restored correctly because they had in-progress data (that is the move of the providedSession.isCompleteObs?.get())
  • Fix a bug where sessions that supported progress streaming would not have sendable messages if they were already complete (that is the addition of this._pendingRequests.deleteAndDispose(model.sessionResource);)
  • Fix a bug in the agent host where we didn't provide onDidStartServerRequest consistently which often prevented multi-client messaging from working
  • DRY up some logic and add tests

- Fix a bug where a sessions were not restored correctly because they
  had in-progress data (that is the move of the `providedSession.isCompleteObs?.get()`)
- Fix a bug where sessions that supported progress streaming would not
  have sendable messages if they were already complete (that is the
	addition of `this._pendingRequests.deleteAndDispose(model.sessionResource);`)
- Fix a bug in the agent host where we didn't provide `onDidStartServerRequest`
  consistently which often prevented multi-client messaging from working
- DRY up some logic and add tests
Copilot AI review requested due to automatic review settings April 17, 2026 17:55
@connor4312 connor4312 enabled auto-merge (squash) April 17, 2026 17:55
@connor4312 connor4312 self-assigned this Apr 17, 2026
Comment thread src/vs/workbench/api/common/extHostChatSessions.ts
@connor4312 connor4312 requested review from roblourens and removed request for roblourens April 17, 2026 17:57
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 17, 2026

Screenshot Changes

Base: 377feb62 Current: 78dbcee7

Changed (7)

chat/artifacts/chatArtifacts/MultiSourceHoveredRow/Light
Before After
before after
editor/inlineCompletions/other/JumpToHint/Dark
Before After
before after
peekReference/PeekReferences/Light
Before After
before after
agentSessionsViewer/CompletedUnread/Dark
Before After
before after
agentSessionsViewer/CompletedUnread/Light
Before After
before after
agentSessionsViewer/WithDiffChanges/Dark
Before After
before after
agentSessionsViewer/WithDiffChanges/Light
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes several edge cases in chat session restoration/cancellation behavior across remote/agent-host sessions, improving reliability of in-progress turn handling and multi-client messaging.

Changes:

  • Adjust remote session load logic to avoid creating/sticking pending requests for already-complete sessions and to clean up pending requests on completion.
  • Make Agent Host sessions consistently expose an interrupt callback and update observable writes atomically for server-initiated turns.
  • Add targeted ChatService tests covering progress-streaming load/cancel/complete scenarios.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/test/common/chatService/chatService.test.ts Adds regression tests for remote-session progress streaming and cancellation behavior.
src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts Refactors remote-session cancellation tracking and ensures pending requests are removed on completion.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts Ensures interrupt callback is always present; batches observable updates for server turns; centralizes cancellation dispatch.
src/vs/workbench/api/common/extHostChatSessions.ts Updates input-state RPC to accept undefined session resource components.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 2

Comment thread src/vs/workbench/api/common/extHostChatSessions.ts Outdated
osortega
osortega previously approved these changes Apr 17, 2026
@connor4312 connor4312 merged commit 99c9ee1 into main Apr 17, 2026
26 checks passed
@connor4312 connor4312 deleted the connor4312/ah-messaging branch April 17, 2026 19:06
@vs-code-engineering vs-code-engineering Bot added this to the 1.117.0 milestone Apr 17, 2026
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.

4 participants