@@ -23,6 +23,9 @@ import { ChatAgentLocation, IChatAgentData, IChatAgentService } from 'vs/workben
23
23
import { IRawChatParticipantContribution } from 'vs/workbench/contrib/chat/common/chatParticipantContribTypes' ;
24
24
import { isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions' ;
25
25
import * as extensionsRegistry from 'vs/workbench/services/extensions/common/extensionsRegistry' ;
26
+ import { INotificationService , Severity } from 'vs/platform/notification/common/notification' ;
27
+ import { Action } from 'vs/base/common/actions' ;
28
+ import { ICommandService } from 'vs/platform/commands/common/commands' ;
26
29
27
30
const chatParticipantExtensionPoint = extensionsRegistry . ExtensionsRegistry . registerExtensionPoint < IRawChatParticipantContribution [ ] > ( {
28
31
extensionPoint : 'chatParticipants' ,
@@ -116,6 +119,8 @@ export class ChatExtensionPointHandler implements IWorkbenchContribution {
116
119
@IProductService private readonly productService : IProductService ,
117
120
@IContextKeyService private readonly contextService : IContextKeyService ,
118
121
@ILogService private readonly logService : ILogService ,
122
+ @INotificationService private readonly notificationService : INotificationService ,
123
+ @ICommandService private readonly commandService : ICommandService ,
119
124
) {
120
125
this . _viewContainer = this . registerViewContainer ( ) ;
121
126
this . registerListeners ( ) ;
@@ -159,6 +164,23 @@ export class ChatExtensionPointHandler implements IWorkbenchContribution {
159
164
private handleAndRegisterChatExtensions ( ) : void {
160
165
chatParticipantExtensionPoint . setHandler ( ( extensions , delta ) => {
161
166
for ( const extension of delta . added ) {
167
+ // Detect old version of Copilot Chat extension.
168
+ // TODO@roblourens remove after one release, after this we will rely on things like the API version
169
+ if ( extension . value . some ( participant => participant . id === 'github.copilot.default' && ! participant . fullName ) ) {
170
+ this . notificationService . notify ( {
171
+ severity : Severity . Error ,
172
+ message : localize ( 'chatFailErrorMessage' , "Chat failed to load. Please ensure that the GitHub Copilot Chat extension is up to date." ) ,
173
+ actions : {
174
+ primary : [
175
+ new Action ( 'showExtension' , localize ( 'action.showExtension' , "Show Extension" ) , undefined , true , ( ) => {
176
+ return this . commandService . executeCommand ( 'workbench.extensions.action.showExtensionsWithIds' , [ 'GitHub.copilot-chat' ] ) ;
177
+ } )
178
+ ]
179
+ }
180
+ } ) ;
181
+ continue ;
182
+ }
183
+
162
184
if ( this . productService . quality === 'stable' && ! isProposedApiEnabled ( extension . description , 'chatParticipantPrivate' ) ) {
163
185
this . logService . warn ( `Chat participants are not yet enabled in VS Code Stable (${ extension . description . identifier . value } )` ) ;
164
186
continue ;
0 commit comments