Remote session reopen can show a stale, incomplete conversation
- 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.

```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
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