3092
3093
protected _resumeSession(sessionId: string): Promise<CopilotAgentSession> {
3094
>
const existing = this._resumingSessions.get(sessionId);
copilotAgent.ts
3095
>
if (existing) {
3096
return existing;
3097
}
3099
>
this._resumingSessions.set(sessionId, promise);
3100
>
const cleanup = () => {
3101
>
if (this._resumingSessions.get(sessionId) === promise) {
3102
>
this._resumingSessions.delete(sessionId);
3103
>
}
3104
>
};
3105
>
promise.then(cleanup, cleanup);
3106
>
return promise;
3107
>
}
3108
3109
private async _doResumeSession(sessionId: string): Promise<CopilotAgentSession> {