Use the default agent name in terminal initial hint

Fixes microsoft/vscode-copilot#5969
This commit is contained in:
Daniel Imms 2024-05-31 11:22:44 -07:00
parent df299ea07b
commit 7906e8f4fb
No known key found for this signature in database
GPG key ID: 5F0FF45B19E3A5D2

View file

@ -193,6 +193,7 @@ class TerminalInitialHintWidget extends Disposable {
constructor(
private readonly _instance: ITerminalInstance,
@IChatAgentService private readonly _chatAgentService: IChatAgentService,
@ICommandService private readonly commandService: ICommandService,
@IConfigurationService private readonly configurationService: IConfigurationService,
@IKeybindingService private readonly keybindingService: IKeybindingService,
@ -219,7 +220,11 @@ class TerminalInitialHintWidget extends Disposable {
}
private _getHintInlineChat(agents: IChatAgent[]) {
const providerName = (agents.length === 1 ? agents[0].fullName : undefined) ?? this.productService.nameShort;
let providerName = (agents.length === 1 ? agents[0].fullName : undefined) ?? this.productService.nameShort;
const defaultAgent = this._chatAgentService.getDefaultAgent(ChatAgentLocation.Panel);
if (defaultAgent?.extensionId.value === agents[0].extensionId.value) {
providerName = defaultAgent.fullName ?? providerName;
}
let ariaLabel = `Ask ${providerName} something or start typing to dismiss.`;