File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -484,8 +484,10 @@ export class CLI {
484484 }
485485
486486 // Handle @ prefix for agent name completion
487- if ( lastWord . startsWith ( '@' ) ) {
488- const searchTerm = lastWord . substring ( 1 ) . toLowerCase ( ) // Remove @ prefix
487+ if ( line . includes ( '@' ) ) {
488+ const $split = line . split ( '@' )
489+ const atAgentPrefix = `@${ $split [ $split . length - 1 ] } `
490+ const searchTerm = atAgentPrefix . substring ( 1 ) . toLowerCase ( ) // Remove @ prefix
489491
490492 // Get all agent names using functional API
491493 const localAgentInfo = getCachedLocalAgentInfo ( )
@@ -503,12 +505,12 @@ export class CLI {
503505 if ( matchingAgents . length > 0 ) {
504506 // Return completions with @ prefix
505507 const completions = matchingAgents . map ( ( name ) => `@${ name } ` )
506- return [ completions , lastWord ]
508+ return [ completions , atAgentPrefix ]
507509 }
508510
509511 // If no agent matches, return empty completions for better UX
510512 // Users typing @ likely intend to mention an agent
511- return [ [ ] , lastWord ]
513+ return [ [ ] , atAgentPrefix ]
512514 }
513515
514516 // Original file path completion logic (unchanged)
You can’t perform that action at this time.
0 commit comments