mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-26 12:44:05 +00:00
chat - rename setup agent back to original name (#244429)
This commit is contained in:
@@ -148,7 +148,7 @@ class SetupChatAgentImplementation extends Disposable implements IChatAgentImple
|
||||
|
||||
disposable.add(chatAgentService.registerAgent(id, {
|
||||
id,
|
||||
name: 'Copilot', // intentionally not using exact same name as extension to avoid conflict with IChatAgentService.getAgentsByName()
|
||||
name: `${defaultChat.providerName} Copilot`,
|
||||
isDefault: true,
|
||||
isCore: true,
|
||||
isToolsAgent,
|
||||
|
||||
@@ -450,7 +450,16 @@ export class ChatAgentService extends Disposable implements IChatAgentService {
|
||||
}
|
||||
|
||||
getAgentsByName(name: string): IChatAgentData[] {
|
||||
return this.getAgents().filter(a => a.name === name);
|
||||
return this._preferExtensionAgents(this.getAgents().filter(a => a.name === name));
|
||||
}
|
||||
|
||||
private _preferExtensionAgents<T extends IChatAgentData>(agents: T[]): T[] {
|
||||
// We potentially have multiple agents on the same location,
|
||||
// contributed from core and from extensions.
|
||||
// This method will prefer the extensions provided agents
|
||||
// falling back to the original agents array extension agent is found.
|
||||
const extensionAgents = agents.filter(a => !a.isCore);
|
||||
return extensionAgents.length > 0 ? extensionAgents : agents;
|
||||
}
|
||||
|
||||
agentHasDupeName(id: string): boolean {
|
||||
|
||||
Reference in New Issue
Block a user