466
467
private _preferExtensionAgent<T extends IChatAgentData>(agents: T[]): T | undefined {
468
>
// We potentially have multiple agents on the same location,
chatAgents.ts
469
>
// contributed from core and from extensions.
470
>
// This method will prefer the last extensions provided agent
471
>
// falling back to the last core agent if no extension agent is found.
472
>
return findLast(agents, agent => !agent.isCore) ?? agents.at(-1);
473
>
}
474
475
getAgent(id: string, includeDisabled = false): IChatAgentData | undefined {