2394
let sideChat: IPersistedChat['sideChat'];
2395
if (options?.fork) {
2397
throw new Error(`[Copilot] createChat fork: missing working directory for session ${session.toString()}`);
2398
}
2399
>
const sourceEntry = await this._resolveChatEntry(session, options.fork.source);
copilotAgent.ts
2400
>
if (!sourceEntry) {
2401
throw new Error(`[Copilot] createChat fork: source chat ${options.fork.source.toString()} not found`);
2402
}
2403
>
const forked = await this._forkSdkChat(client, sourceEntry, options.fork.turnId, this._sessionDataService.getSessionDataDir(chat));
copilotAgent.ts
2404
>
sdkSessionId = forked.sessionId;
2405
>
launchPlan = {
2406
>
kind: 'resume',
2407
>
client,
2408
>
sessionId: sdkSessionId,
2409
>
workingDirectory,
2410
>
resolvedAgentName: undefined,
2411
>
snapshot,
2412
>
activeClientToolSet: activeClient.toolSet,
2413
>
shellManager,
2414
>
githubToken: this._githubToken,
2415
>
fallback: { model, longContextWindow: this._longContextWindowFor(model?.id), freeLongContext: this._isFreeLongContext(model?.id) },
2416
>
};
2417
} else if (options?.sideChat) {
2418
if (!workingDirectory) {