@@ -417,6 +417,13 @@ export class ChatController {
417417 }
418418 }
419419
420+ private getHighlightCommand ( ) {
421+ const highlightCommand = FeatureConfigProvider . getFeature ( Features . highlightCommand )
422+ const commandName = highlightCommand ?. value . stringValue
423+ const commandDescription = highlightCommand ?. variation
424+ return commandName ? { commandName, commandDescription } : undefined
425+ }
426+
420427 private async processContextCommandUpdateMessage ( ) {
421428 // when UI is ready, refresh the context commands
422429 this . registerUserPromptsWatcher ( )
@@ -461,10 +468,9 @@ export class ChatController {
461468 } ,
462469 ]
463470
464- const feature = FeatureConfigProvider . getFeature ( Features . highlightCommand )
465- const commandName = feature ?. value . stringValue
466- if ( commandName ) {
467- const commandDescription = feature . variation
471+ const highlightCommand = this . getHighlightCommand ( )
472+ if ( highlightCommand ) {
473+ const { commandName, commandDescription } = highlightCommand
468474 contextCommand . push ( {
469475 groupName : 'Additional Commands' ,
470476 commands : [ { command : commandName , description : commandDescription } ] ,
@@ -1056,6 +1062,19 @@ export class ChatController {
10561062 triggerPayload . context ?. some (
10571063 ( context ) => typeof context !== 'string' && context . command === '@workspace'
10581064 ) || false
1065+
1066+ // Fix for mynah-ui removing @ from commandName
1067+ const feature = this . getHighlightCommand ( )
1068+ const commandName = feature ?. commandName
1069+ if (
1070+ commandName &&
1071+ triggerPayload . message &&
1072+ triggerPayload . context ?. find ( ( context ) => typeof context !== 'string' && context . command === commandName )
1073+ ) {
1074+ const truncatedCommand = commandName . startsWith ( '@' ) ? commandName . slice ( 1 ) : commandName
1075+ triggerPayload . message = triggerPayload . message . replace ( truncatedCommand , commandName )
1076+ }
1077+
10591078 triggerPayload . documentReferences = [ ]
10601079 if ( triggerPayload . useRelevantDocuments && triggerPayload . message ) {
10611080 triggerPayload . message = triggerPayload . message . replace ( / w o r k s p a c e / , '' )
0 commit comments