2416
};
2417
} else if (options?.sideChat) {
2419
throw new Error(`[Copilot] createChat side chat: missing working directory for session ${session.toString()}`);
2420
}
2421
>
const sourceEntry = await this._resolveChatEntry(session, options.sideChat.source);
copilotAgent.ts
2422
>
if (!sourceEntry) {
2423
throw new Error(`[Copilot] createChat side chat: source chat ${options.sideChat.source.toString()} not found`);
2424
}
2425
>
const forked = await this._forkSdkChat(client, sourceEntry, options.sideChat.providerAnchorTurnId ?? options.sideChat.turnId, this._sessionDataService.getSessionDataDir(chat));
copilotAgent.ts
2426
>
sdkSessionId = forked.sessionId;
2427
>
sideChat = {
2428
>
source: options.sideChat.source.toString(),
2429
>
turnId: options.sideChat.turnId,
2430
>
...(options.sideChat.selection ? { selection: options.sideChat.selection } : {}),
2431
>
...(options.sideChat.providerAnchorTurnId ? { providerAnchorTurnId: options.sideChat.providerAnchorTurnId } : {}),
2432
>
inheritedTurnCount: forked.inheritedTurnCount,
2433
>
...(options.sideChat.sourceContext ? { context: options.sideChat.sourceContext } : {}),
2434
>
...(options.sideChat.partialResponse ? { partialResponse: options.sideChat.partialResponse } : {}),
2435
>
};
2436
>
launchPlan = {
2437
>
kind: 'resume',
2438
>
client,
2439
>
sessionId: sdkSessionId,
2440
>
workingDirectory,
2441
>
resolvedAgentName: undefined,
2442
>
snapshot,
2443
>
activeClientToolSet: activeClient.toolSet,
2444
>
shellManager,
2445
>
githubToken: this._githubToken,
2446
>
fallback: { model, longContextWindow: this._longContextWindowFor(model?.id), freeLongContext: this._isFreeLongContext(model?.id) },
2447
>
};
2448
} else {
2449
sdkSessionId = chatSdkId;