1966
1967
const originalAgentName = this._resolveAgentName(snapshot, agent);
1968
>
const alternativeAgentName = alternativeAgent ? this._resolveAgentName(snapshot, alternativeAgent) : undefined;
copilotAgent.ts
1969
>
1970
>
if (originalAgentName) {
1971
return { agent: agent, name: originalAgentName };
1972
}
1974
this._logService.info(`[Copilot] Agent file ${agent.uri} is in the original repo; using worktree agent ${alternativeAgent?.uri}`);
1975
return { agent: alternativeAgent, name: alternativeAgentName };
1976
}
1977
return undefined;
1979
private _getAlternativeAgentForWorktree(provisional: IProvisionalSession, workingDirectory: URI | undefined): AgentSelection | undefined {
1980
const agent = provisional.agent;