@@ -136,29 +136,29 @@ export class ChatSetupContribution extends Disposable implements IWorkbenchContr
136136 panelAgentDisposables . dispose ( ) ;
137137 }
138138 } ) ) ;
139- }
139+ }
140140
141- // Proactively clear panel agents when Copilot reports GitHub login failure
142- // (e.g. workspace PAT cannot be exchanged for a Copilot token)
143- const gitHubLoginFailedKey = 'github.copilot.interactiveSession.gitHubLoginFailed' ;
144- const checkGitHubLoginFailed = ( ) => {
145- if ( this . contextKeyService . getContextKeyValue < boolean > ( gitHubLoginFailedKey ) ) {
146- const panelAgentHasGuidance = chatViewsWelcomeRegistry . get ( ) . some ( descriptor => this . contextKeyService . contextMatchesRules ( descriptor . when ) ) ;
147- if ( panelAgentHasGuidance ) {
148- this . logService . error ( '[chat setup] GitHub login failed detected, clearing panel agent registration to show welcome view.' ) ;
149- panelAgentDisposables . dispose ( ) ;
141+ // Proactively clear panel agents when Copilot reports GitHub login failure
142+ // (e.g. workspace PAT cannot be exchanged for a Copilot token)
143+ const gitHubLoginFailedKey = 'github.copilot.interactiveSession.gitHubLoginFailed' ;
144+ const checkGitHubLoginFailed = ( ) => {
145+ if ( this . contextKeyService . getContextKeyValue < boolean > ( gitHubLoginFailedKey ) ) {
146+ const panelAgentHasGuidance = chatViewsWelcomeRegistry . get ( ) . some ( descriptor => this . contextKeyService . contextMatchesRules ( descriptor . when ) ) ;
147+ if ( panelAgentHasGuidance ) {
148+ this . logService . error ( '[chat setup] GitHub login failed detected, clearing panel agent registration to show welcome view.' ) ;
149+ panelAgentDisposables . dispose ( ) ;
150+ }
150151 }
151- }
152- } ;
153- panelAgentDisposables . add ( this . contextKeyService . onDidChangeContext ( e => {
154- if ( e . affectsSome ( new Set ( [ gitHubLoginFailedKey ] ) ) ) {
155- checkGitHubLoginFailed ( ) ;
156- }
157- } ) ) ;
158- checkGitHubLoginFailed ( ) ;
152+ } ;
153+ panelAgentDisposables . add ( this . contextKeyService . onDidChangeContext ( e => {
154+ if ( e . affectsSome ( new Set ( [ gitHubLoginFailedKey ] ) ) ) {
155+ checkGitHubLoginFailed ( ) ;
156+ }
157+ } ) ) ;
158+ checkGitHubLoginFailed ( ) ;
159159
160- // Inline Agents
161- disposables . add ( SetupAgent . registerDefaultAgents ( this . instantiationService , ChatAgentLocation . Terminal , ChatModeKind . Ask , context , controller ) . disposable ) ;
160+ // Inline Agents
161+ disposables . add ( SetupAgent . registerDefaultAgents ( this . instantiationService , ChatAgentLocation . Terminal , ChatModeKind . Ask , context , controller ) . disposable ) ;
162162 disposables . add ( SetupAgent . registerDefaultAgents ( this . instantiationService , ChatAgentLocation . Notebook , ChatModeKind . Ask , context , controller ) . disposable ) ;
163163 disposables . add ( SetupAgent . registerDefaultAgents ( this . instantiationService , ChatAgentLocation . EditorInline , ChatModeKind . Ask , context , controller ) . disposable ) ;
164164 }
0 commit comments