Skip to content

agentHost: fix broken state leading to misrouted messages#311572

Merged
connor4312 merged 1 commit intomainfrom
connor4312/fix-torn-ah-session
Apr 21, 2026
Merged

agentHost: fix broken state leading to misrouted messages#311572
connor4312 merged 1 commit intomainfrom
connor4312/fix-torn-ah-session

Conversation

@connor4312
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 21, 2026 00:35
@connor4312 connor4312 enabled auto-merge (squash) April 21, 2026 00:35
@connor4312 connor4312 self-assigned this Apr 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 00f882a1 Current: 04618827

Changed (4)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Light
Before After
before after
editor/inlineCompletions/other/JumpToHint/Dark
Before After
before after
agentSessionsViewer/CompletedUnread/Dark
Before After
before after
agentSessionsViewer/CompletedUnread/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 a lifecycle ordering bug in agent-host backed chat sessions where a disposed session could remain cached (leading to subsequent messages being routed to a disposed/mismatched session).

Changes:

  • Ensure AgentHostChatSession.onWillDispose fires before Disposable teardown by overriding dispose().
  • Add a regression test asserting onWillDispose fires exactly once when disposing an agent-host chat session.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts Fires onWillDispose before super.dispose() to allow cache eviction before teardown.
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts Adds coverage to prevent regressions in session disposal event ordering.

Copilot's findings

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

@connor4312 connor4312 merged commit cf07096 into main Apr 21, 2026
30 checks passed
@connor4312 connor4312 deleted the connor4312/fix-torn-ah-session branch April 21, 2026 00:57
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 21, 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.

3 participants