3030
throw new CancellationError();
3031
}
3032
>
// Reuse an existing entry (which may already host peer chats created
copilotAgent.ts
3033
>
// while the default chat was still provisional) rather than replacing
3034
>
// it, which would dispose those peers. The default chat is seeded into
3035
>
// the entry's uniform chat map keyed by its default-chat URI.
3036
>
const defaultChatKey = buildDefaultChatUri(agentSession.sessionUri.toString());
3037
>
let entry = this._sessions.get(sessionId);
3038
>
if (!entry) {
3039
>
entry = new CopilotSessionEntry();
3040
>
this._sessions.set(sessionId, entry);
3041
>
}
3042
>
entry.setDefaultChat(defaultChatKey, new CopilotSessionEntry(agentSession));
3043
}
3044