microsoft / microsoft/vscode

Remote session reopen can show a stale, incomplete conversation

Open
#336,638 0 comments 0 reactions 1 assignee Assigned to @roblourens View on GitHub
bug
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Reopening a remote session can reuse a stale cached chat model that will never get updated if it was disconnected when the chat completed. The chat appears in progress in the chat, but looks idle in the session list.

![Remote session showing stale in-progress conversation while the session list shows it idle](https://github.com/user-attachments/assets/4d289f81-e823-4b15-b0ec-2385444dae7a)

```typescript
const existingRef = this.acquireExistingSession(sessionResource, debugOwner);
if (existingRef) {
this.trace('loadRemoteSession', `reused existing model for ${sessionResource.toString()}`);
return existingRef;
}
```
This path returns the existing `ChatModel` before resolving the reconnected provider's session with `getOrCreateChatSession`. If the cached model was attached to the old connection when it disconnected, it never receives the authoritative completed snapshot: its completion observable remains in progress and response parts produced while disconnected are never added to the conversation.

Contributor guide

Open the contributing guide

Research direction

Start at ChatService#loadRemoteSession and trace the reused cached-model path against the reconnected provider’s authoritative session snapshot. Reproduce the disconnect/reconnect sequence, then verify that reopening shows the completed turn, all post-disconnect content, and matching idle/completed state; use the relevant remote-session or chat tests if present.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
desktop, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.