Restore PR extension management with API-first approach#1639
Conversation
- Restore IEnvService import and constructor parameter - Restore isPullRequestExtensionInstalled() method - Restore installPullRequestExtension() method with improvements: - Added JSDoc comments - Added logging for better debugging - Improved error handling - Restore context key setting for PR extension installed - Restore proxy commands (checkoutFromDescription, applyChangesFromDescription) - Keep CLOSE_SESSION_PR_CMD using GitHub API directly (no extension required) - Added comments to clarify the approach Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
|
@copilot you need to actually show the button to install the extension in the chat part, eg: contributes.menu |
- Add command definitions for checkoutFromDescription and applyChangesFromDescription - Add localized titles in package.nls.json - Add menu items in chat/chatSessions that appear when PR extension is not installed - Commands use context key !github.copilot.prExtensionInstalled to conditionally show - Commands will trigger automatic installation of GitHub Pull Request extension Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Added UI menu contributions in commit f2f7859. The commands now appear in the chat sessions context menu for
Both commands use the context key The menu items are in the |
Restores logic from commit 1cafcac that was removed, polishing it to align with the GitHub API-first pattern established in commit 361cb48.
Changes
Restored extension management infrastructure:
isPullRequestExtensionInstalled()- checks extension availabilityinstallPullRequestExtension()- auto-installs extension with prerelease detection for Insiders buildsprExtensionInstalledContextKeyCommand routing strategy:
checkoutFromDescriptionandapplyChangesFromDescription- proxy commands that install PR extension on-demand (requires extension functionality)closeChatSessionPullRequest- uses GitHub API directly (no extension required)UI Integration:
chat/chatSessionsfor checkout and apply changes commands!github.copilot.prExtensionInstalledto conditionally show menu itemsImprovements:
Example
User Experience
When viewing copilot-cloud-agent chat sessions without the GitHub Pull Request extension installed, users will see:
These buttons automatically disappear once the PR extension is installed, providing a seamless onboarding experience.
Created from VS Code via the GitHub Pull Request extension.
Original prompt
Created from VS Code via the GitHub Pull Request extension.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.