@@ -192,7 +192,7 @@ class SetupAgent extends Disposable implements IChatAgentImplementation {
192
192
return { agent, disposable : disposables } ;
193
193
}
194
194
195
- private static readonly SETUP_NEEDED_MESSAGE = new MarkdownString ( localize ( 'settingUpCopilotNeeded' , "You need to set up Copilot to use Chat." ) ) ;
195
+ private static readonly SETUP_NEEDED_MESSAGE = new MarkdownString ( localize ( 'settingUpCopilotNeeded' , "You need to set up Copilot and be signed in to use Chat." ) ) ;
196
196
197
197
private readonly _onUnresolvableError = this . _register ( new Emitter < void > ( ) ) ;
198
198
readonly onUnresolvableError = this . _onUnresolvableError . event ;
@@ -1438,6 +1438,8 @@ class ChatSetupController extends Disposable {
1438
1438
this . setStep ( ChatSetupStep . SigningIn ) ;
1439
1439
const result = await this . signIn ( providerId ) ;
1440
1440
if ( ! result . session ) {
1441
+ this . doInstall ( ) ; // still install the extension in the background to remind the user to sign-in eventually
1442
+
1441
1443
this . telemetryService . publicLog2 < InstallChatEvent , InstallChatClassification > ( 'commandCenter.chatInstall' , { installResult : 'failedNotSignedIn' , installDuration : watch . elapsed ( ) , signUpErrorCode : undefined } ) ;
1442
1444
return undefined ; // treat as cancelled because signing in already triggers an error dialog
1443
1445
}
@@ -1521,7 +1523,7 @@ class ChatSetupController extends Disposable {
1521
1523
}
1522
1524
}
1523
1525
1524
- await this . doInstall ( ) ;
1526
+ await this . doInstallWithRetry ( ) ;
1525
1527
} catch ( error ) {
1526
1528
this . logService . error ( `[chat setup] install: error ${ error } ` ) ;
1527
1529
this . telemetryService . publicLog2 < InstallChatEvent , InstallChatClassification > ( 'commandCenter.chatInstall' , { installResult : isCancellationError ( error ) ? 'cancelled' : 'failedInstall' , installDuration : watch . elapsed ( ) , signUpErrorCode : undefined } ) ;
@@ -1539,16 +1541,10 @@ class ChatSetupController extends Disposable {
1539
1541
return true ;
1540
1542
}
1541
1543
1542
- private async doInstall ( ) : Promise < void > {
1544
+ private async doInstallWithRetry ( ) : Promise < void > {
1543
1545
let error : Error | undefined ;
1544
1546
try {
1545
- await this . extensionsWorkbenchService . install ( defaultChat . extensionId , {
1546
- enable : true ,
1547
- isApplicationScoped : true , // install into all profiles
1548
- isMachineScoped : false , // do not ask to sync
1549
- installEverywhere : true , // install in local and remote
1550
- installPreReleaseVersion : this . productService . quality !== 'stable'
1551
- } , ChatViewId ) ;
1547
+ await this . doInstall ( ) ;
1552
1548
} catch ( e ) {
1553
1549
this . logService . error ( `[chat setup] install: error ${ error } ` ) ;
1554
1550
error = e ;
@@ -1564,14 +1560,24 @@ class ChatSetupController extends Disposable {
1564
1560
} ) ;
1565
1561
1566
1562
if ( confirmed ) {
1567
- return this . doInstall ( ) ;
1563
+ return this . doInstallWithRetry ( ) ;
1568
1564
}
1569
1565
}
1570
1566
1571
1567
throw error ;
1572
1568
}
1573
1569
}
1574
1570
1571
+ private async doInstall ( ) : Promise < void > {
1572
+ await this . extensionsWorkbenchService . install ( defaultChat . extensionId , {
1573
+ enable : true ,
1574
+ isApplicationScoped : true , // install into all profiles
1575
+ isMachineScoped : false , // do not ask to sync
1576
+ installEverywhere : true , // install in local and remote
1577
+ installPreReleaseVersion : this . productService . quality !== 'stable'
1578
+ } , ChatViewId ) ;
1579
+ }
1580
+
1575
1581
async setupWithProvider ( options : { useEnterpriseProvider : boolean } ) : Promise < ChatSetupResultValue > {
1576
1582
const registry = Registry . as < IConfigurationRegistry > ( ConfigurationExtensions . Configuration ) ;
1577
1583
registry . registerConfiguration ( {
0 commit comments