mirror of
https://github.com/Microsoft/vscode
synced 2024-10-12 14:30:13 +00:00
Fix multiple agent id/name mixups (#208450)
This commit is contained in:
parent
a7dc4a5246
commit
34f6d642e6
|
@ -267,7 +267,7 @@ class ChatSlashStaticSlashCommandsContribution extends Disposable {
|
|||
const agentText = (await Promise.all(agents
|
||||
.filter(a => a.id !== defaultAgent?.id)
|
||||
.map(async a => {
|
||||
const agentWithLeader = `${chatAgentLeader}${a.id}`;
|
||||
const agentWithLeader = `${chatAgentLeader}${a.name}`;
|
||||
const actionArg: IChatExecuteActionContext = { inputValue: `${agentWithLeader} ${a.metadata.sampleRequest}` };
|
||||
const urlSafeArg = encodeURIComponent(JSON.stringify(actionArg));
|
||||
const agentLine = `* [\`${agentWithLeader}\`](command:${SubmitAction.ID}?${urlSafeArg}) - ${a.description}`;
|
||||
|
|
|
@ -45,7 +45,13 @@ export class ChatFollowups<T extends IChatFollowup | IInlineChatFollowup> extend
|
|||
|
||||
let tooltipPrefix = '';
|
||||
if ('agentId' in followup && followup.agentId && followup.agentId !== this.chatAgentService.getDefaultAgent(this.location)?.id) {
|
||||
tooltipPrefix += `${chatAgentLeader}${followup.agentId} `;
|
||||
const agent = this.chatAgentService.getAgent(followup.agentId);
|
||||
if (!agent) {
|
||||
// Refers to agent that doesn't exist
|
||||
return;
|
||||
}
|
||||
|
||||
tooltipPrefix += `${chatAgentLeader}${agent.name} `;
|
||||
if ('subCommand' in followup && followup.subCommand) {
|
||||
tooltipPrefix += `${chatSubcommandLeader}${followup.subCommand} `;
|
||||
}
|
||||
|
|
|
@ -504,7 +504,7 @@ class SubmitButtonActionViewItem extends ActionViewItem {
|
|||
if (secondaryAgent) {
|
||||
const secondaryKeybinding = keybindingService.lookupKeybinding(ChatSubmitSecondaryAgentEditorAction.ID)?.getLabel();
|
||||
if (secondaryKeybinding) {
|
||||
tooltip += `\n${chatAgentLeader}${secondaryAgent.id} (${secondaryKeybinding})`;
|
||||
tooltip += `\n${chatAgentLeader}${secondaryAgent.name} (${secondaryKeybinding})`;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -211,7 +211,7 @@ class InputEditorDecorations extends Disposable {
|
|||
|
||||
const textDecorations: IDecorationOptions[] | undefined = [];
|
||||
if (agentPart) {
|
||||
const agentHover = `(${agentPart.agent.id}) ${agentPart.agent.description}`;
|
||||
const agentHover = `(${agentPart.agent.name}) ${agentPart.agent.description}`;
|
||||
textDecorations.push({ range: agentPart.editorRange, hoverMessage: new MarkdownString(agentHover) });
|
||||
if (agentSubcommandPart) {
|
||||
textDecorations.push({ range: agentSubcommandPart.editorRange, hoverMessage: new MarkdownString(agentSubcommandPart.command.description) });
|
||||
|
|
Loading…
Reference in a new issue