@@ -66,6 +66,7 @@ class InputEditorDecorations extends Disposable {
66
66
67
67
this . updateInputEditorDecorations ( ) ;
68
68
this . _register ( this . widget . inputEditor . onDidChangeModelContent ( ( ) => this . updateInputEditorDecorations ( ) ) ) ;
69
+ this . _register ( this . widget . onDidChangeParsedInput ( ( ) => this . updateInputEditorDecorations ( ) ) ) ;
69
70
this . _register ( this . widget . onDidChangeViewModel ( ( ) => {
70
71
this . registerViewModelListeners ( ) ;
71
72
this . previouslyUsedAgents . clear ( ) ;
@@ -211,7 +212,9 @@ class InputEditorDecorations extends Disposable {
211
212
212
213
const textDecorations : IDecorationOptions [ ] | undefined = [ ] ;
213
214
if ( agentPart ) {
214
- const agentHover = `(${ agentPart . agent . name } ) ${ agentPart . agent . description } ` ;
215
+ const isDupe = ! ! this . chatAgentService . getAgents ( ) . find ( other => other . name === agentPart . agent . name && other . id !== agentPart . agent . id ) ;
216
+ const id = isDupe ? `(${ agentPart . agent . id } ) ` : '' ;
217
+ const agentHover = `${ id } ${ agentPart . agent . description } ` ;
215
218
textDecorations . push ( { range : agentPart . editorRange , hoverMessage : new MarkdownString ( agentHover ) } ) ;
216
219
if ( agentSubcommandPart ) {
217
220
textDecorations . push ( { range : agentSubcommandPart . editorRange , hoverMessage : new MarkdownString ( agentSubcommandPart . command . description ) } ) ;
@@ -456,7 +459,8 @@ class AgentCompletions extends Disposable {
456
459
insertText : `${ agentLabel } ` ,
457
460
range : new Range ( 1 , 1 , 1 , 1 ) ,
458
461
kind : CompletionItemKind . Text ,
459
- sortText : `${ chatSubcommandLeader } ${ agent . name } ` ,
462
+ sortText : `${ chatSubcommandLeader } ${ agent . id } ` ,
463
+ command : { id : AssignSelectedAgentAction . ID , title : AssignSelectedAgentAction . ID , arguments : [ { agent, widget } satisfies AssignSelectedAgentActionArgs ] } ,
460
464
} ;
461
465
} ) ;
462
466
@@ -473,7 +477,8 @@ class AgentCompletions extends Disposable {
473
477
detail : `(${ agentLabel } ) ${ c . description ?? '' } ` ,
474
478
range : new Range ( 1 , 1 , 1 , 1 ) ,
475
479
kind : CompletionItemKind . Text , // The icons are disabled here anyway
476
- sortText : `${ chatSubcommandLeader } ${ agent . name } ${ c . name } ` ,
480
+ sortText : `${ chatSubcommandLeader } ${ agent . id } ${ c . name } ` ,
481
+ command : { id : AssignSelectedAgentAction . ID , title : AssignSelectedAgentAction . ID , arguments : [ { agent, widget } satisfies AssignSelectedAgentActionArgs ] } ,
477
482
} satisfies CompletionItem ;
478
483
} ) ) )
479
484
} ;
0 commit comments