diff --git a/package.json b/package.json index 8fb5ae392a..e4d13cd531 100644 --- a/package.json +++ b/package.json @@ -2667,7 +2667,7 @@ }, { "command": "pr.preferredCodingAgentGitHubRemote", - "when": "view == workbench.view.chat.sessions.copilot-swe-agent", + "when": "github:hasMultipleGitHubRemotes && view == workbench.view.chat.sessions.copilot-swe-agent", "group": "navigation@1" } ], diff --git a/src/github/folderRepositoryManager.ts b/src/github/folderRepositoryManager.ts index 248d3b5891..fdabdfc895 100644 --- a/src/github/folderRepositoryManager.ts +++ b/src/github/folderRepositoryManager.ts @@ -428,6 +428,9 @@ export class FolderRepositoryManager extends Disposable { if (activeRemotes.length) { await vscode.commands.executeCommand('setContext', 'github:hasGitHubRemotes', true); Logger.appendLine(`Found GitHub remote for folder ${this.repository.rootUri.fsPath}`, this.id); + if (this._allGitHubRemotes.length > 1) { + await vscode.commands.executeCommand('setContext', 'github:hasMultipleGitHubRemotes', true); + } } else { Logger.appendLine(`No GitHub remotes found for folder ${this.repository.rootUri.fsPath}`, this.id); }