Skip to content

Comments

fix sending new chat request in sessions window#295815

Merged
sandy081 merged 2 commits intomainfrom
sandy081/exciting-warbler
Feb 17, 2026
Merged

fix sending new chat request in sessions window#295815
sandy081 merged 2 commits intomainfrom
sandy081/exciting-warbler

Conversation

@sandy081
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings February 17, 2026 18:09
@sandy081 sandy081 enabled auto-merge (squash) February 17, 2026 18:09
@sandy081 sandy081 self-assigned this Feb 17, 2026
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 17, 2026
Copy link
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

This PR fixes a race condition when sending new chat requests in the sessions window. The issue occurred when the chat view pane was restoring a session (e.g., from onDidChangeAgents) while simultaneously trying to load a new session, causing the wrong session to be displayed.

Changes:

  • Refactored ChatViewPane.applyModel() to track in-progress session restoration via restoringSession promise
  • Added synchronization in ChatViewPane.loadSession() to wait for any in-progress restoration before loading a new session
  • Moved isNewChatSessionContext.set(false) timing in SessionsWorkbenchService.openSession() to after model loading to prevent flickering
  • Added race condition handling in SessionsWorkbenchService.openSessionAndSend() to wait for agent session creation with a 30-second timeout
  • Adjusted CSS padding for the chat editor from 0 10px to 0 6px 6px 6px for better visual spacing

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.ts Refactored applyModel() to track restoration promise and added synchronization in loadSession() to prevent race conditions
src/vs/sessions/contrib/sessions/browser/sessionsWorkbenchService.ts Delayed context key updates until after model loading and added Promise.race to wait for new session creation after send
src/vs/sessions/contrib/chat/browser/media/chatWidget.css Adjusted editor padding to add bottom and horizontal spacing

@sandy081 sandy081 merged commit 841dac9 into main Feb 17, 2026
28 of 29 checks passed
@sandy081 sandy081 deleted the sandy081/exciting-warbler branch February 17, 2026 19:21
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.

2 participants