fix(server): update Chocolatey OpenCode on Windows - #9546
Open
Baker-Harrison wants to merge 6 commits into
Open
Conversation
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a localized server-side fix that makes the existing provider update action target Chocolatey-managed OpenCode installations instead of an unrelated npm installation. Its runtime impact is narrowly scoped, covered by regression tests, and introduces no schema, deployment, security, billing, or authentication changes. You can add or adjust custom eligibility rules. Learn more. |
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.
What Changed
choco upgrade opencode --yesinstead of updating an unrelated npm installation.Why
On Windows, a Chocolatey OpenCode shim can appear before a newer npm installation on PATH. T3 Code previously probed the older Chocolatey binary but ran the npm updater, reported success, and continued showing OpenCode as too old after restart. The update action now targets the package manager that owns the executable T3 Code actually resolved.
Checklist
Verification
vp test run apps/server/src/provider/providerMaintenance.test.tsvp fmt --checkon the three changed filesvp linton the three changed filesvp run --filter t3 typecheckGenerated with gpt-5.6-sol via the T3 Code Codex harness.
Note
Medium Risk
Changes which external command runs for in-app provider updates on Windows; wrong detection could block updates or target the wrong package manager, though precedence after npm/pnpm/Homebrew is unchanged.
Overview
Fixes Windows provider self-updates when the resolved binary comes from a Chocolatey shim (e.g. OpenCode ahead of npm on
PATH). Maintenance resolution now detects shims under the defaultProgramData\chocolatey\binpath or a custom install viaChocolateyInstall, picks the siblingchoco.exe, and exposeschoco upgrade <package> --yeswith lock keychocolateyinstead of npm/Homebrew updaters.Adds optional
chocolateyPackageNameon package-managed provider definitions; OpenCode sets it toopencode. Providers without a Chocolatey name still fall back to manual-only when a shim is detected. Command lookup env now includesChocolateyInstall. Regression tests cover default and custom Chocolatey layouts onwin32.Reviewed by Cursor Bugbot for commit 5438ac4. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add Chocolatey update support for OpenCode on Windows
chocolateyPackageNametoPackageManagedProviderMaintenanceDefinitionand sets it toopencodefor the OpenCode provider so Chocolatey installs can self-updateresolveChocolateyUpdateExecutablewhich detects binaries under the default Chocolatey bin directory or aChocolateyInstall-derived path, then resolves the siblingchoco.exeresolvePackageManagedProviderMaintenance; definitions without a Chocolatey package name fall back to manual-onlyCommandLookupEnvConfignow carries an optionalChocolateyInstallvalue; providers withoutchocolateyPackageNameare unaffected and existing package-manager precedence is preservedMacroscope summarized 5438ac4.