@@ -218,7 +218,7 @@ export class CopilotRemoteAgentManager extends Disposable {
218218 await this . context . workspaceState . update ( PREFERRED_GITHUB_CODING_AGENT_REMOTE_WORKSPACE_KEY , undefined ) ;
219219 }
220220
221- public async promptAndUpdatePreferredGitHubRemote ( skipIfValueAlreadyCached = false ) : Promise < GitHubRemote | undefined > {
221+ public async promptAndUpdatePreferredGitHubRemote ( skipIfValueAlreadyCached = false ) : Promise < void > {
222222 if ( skipIfValueAlreadyCached ) {
223223 const cachedValue = await this . context . workspaceState . get ( PREFERRED_GITHUB_CODING_AGENT_REMOTE_WORKSPACE_KEY ) ;
224224 if ( cachedValue ) {
@@ -233,7 +233,8 @@ export class CopilotRemoteAgentManager extends Disposable {
233233
234234 const ghRemotes = await fm . getAllGitHubRemotes ( ) ;
235235 Logger . trace ( `There are ${ ghRemotes . length } GitHub remotes available to select from` , CopilotRemoteAgentManager . ID ) ;
236- if ( ! ghRemotes || ghRemotes . length === 0 ) {
236+ if ( ! ghRemotes || ghRemotes . length <= 1 ) {
237+ Logger . trace ( 'No need to select a coding agent GitHub remote, skipping prompt' , CopilotRemoteAgentManager . ID ) ;
237238 return ;
238239 }
239240
@@ -252,7 +253,6 @@ export class CopilotRemoteAgentManager extends Disposable {
252253
253254 Logger . appendLine ( `Updated '${ result . remoteName } ' as preferred coding agent remote` , CopilotRemoteAgentManager . ID ) ;
254255 await this . context . workspaceState . update ( PREFERRED_GITHUB_CODING_AGENT_REMOTE_WORKSPACE_KEY , result . remoteName ) ;
255- return result ;
256256 }
257257
258258 async repoInfo ( fm ?: FolderRepositoryManager ) : Promise < RepoInfo | undefined > {
@@ -518,9 +518,7 @@ export class CopilotRemoteAgentManager extends Disposable {
518518 return { error : vscode . l10n . t ( 'Failed to initialize Copilot API' ) , state : 'error' } ;
519519 }
520520
521- if ( ! await this . promptAndUpdatePreferredGitHubRemote ( true ) ) {
522- return { error : vscode . l10n . t ( 'Cancelled setting preferred GitHub remote' ) , state : 'error' } ;
523- }
521+ await this . promptAndUpdatePreferredGitHubRemote ( true ) ;
524522
525523 const repoInfo = await this . repoInfo ( ) ;
526524 if ( ! repoInfo ) {
0 commit comments