fix(upgrade): check extension version before calling gotoAgentMode#1022
Open
frankliu20 wants to merge 1 commit into
Open
Conversation
- Add MIN_APPMOD_VERSION (1.15.0) constant and check installed extension version before proceeding, fixing failures when extension is outdated - Show reload prompt when extension is updated (not freshly installed) - Distinguish three extension states (up-to-date/outdated/not-installed) in notification button text and message body - Rename display name to "GitHub Copilot modernization" Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses the high failure rate of _java.upgradeWithCopilot (~67% of failures due to appmod.javaUpgrade.gotoAgentMode not being found) by detecting when the app modernization extension is installed but predates the version (1.15.0) that registers gotoAgentMode. It also refines notification UX to differentiate three extension states and refreshes the extension display name to match its current marketplace name.
Changes:
- Add
Upgrade.MIN_APPMOD_VERSION = "1.15.0"and version-check the installed extension incheckOrInstallAppModExtensionForUpgrade, prompting a window reload after update. - Introduce an
ExtensionState(up-to-date | outdated | not-installed) used to drive both notification button text and message body wording. - Rename the display constant to "GitHub Copilot modernization".
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/constants.ts | Adds MIN_APPMOD_VERSION constant and renames the modernization extension display name. |
| src/upgrade/utility.ts | Replaces boolean hasExtension parameter with ExtensionState, centralizes action-word generation, and adds version check + reload prompt for outdated extension. |
| src/upgrade/display/notificationManager.ts | Computes three-state extension status via semver.gte and selects button labels / message wording accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
180
to
194
| await commands.executeCommand("workbench.extensions.installExtension", ExtensionName.APP_MODERNIZATION_FOR_JAVA); | ||
|
|
||
| if (ext) { | ||
| // Extension was updated (not freshly installed) — reload required | ||
| const reload = await window.showInformationMessage( | ||
| "GitHub Copilot modernization extension has been updated. Reload VS Code to start the upgrade experience.", | ||
| "Reload Now" | ||
| ); | ||
| if (reload === "Reload Now") { | ||
| await commands.executeCommand("workbench.action.reloadWindow"); | ||
| } | ||
| return; | ||
| } | ||
|
|
||
| await checkOrPromptToEnableAppModExtension("upgrade"); |
| if (ext) { | ||
| // Extension was updated (not freshly installed) — reload required | ||
| const reload = await window.showInformationMessage( | ||
| "GitHub Copilot modernization extension has been updated. Reload VS Code to start the upgrade experience.", |
leonard520
reviewed
May 28, 2026
| if (version && semver.gte(version, Upgrade.MIN_APPMOD_VERSION)) { | ||
| return "up-to-date"; | ||
| } | ||
| return "outdated"; |
There was a problem hiding this comment.
If version is undefined, it will go to this condition.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
From telemetry analysis, ~67% of
_java.upgradeWithCopilotfailures are"command 'appmod.javaUpgrade.gotoAgentMode' not found". This happens because the appmod extension is installed but too old (< 1.15.0) to register thegotoAgentModecommand. The current code only checks whether the extension is installed, not whether it's up-to-date.Additionally, the notification button says "Upgrade Now" even when the user needs to install or update the appmod extension first — which is confusing.
What
Version check before
gotoAgentMode—checkOrInstallAppModExtensionForUpgradenow verifies the installed extension version is ≥ 1.15.0. If outdated, it triggers an update viaworkbench.extensions.installExtensionand prompts the user to reload VS Code (required for the updated extension to take effect).Three-state notification UX — Notification buttons and message body now distinguish between:
Display name update — Renamed to "GitHub Copilot modernization" to match the extension's current marketplace name.