Repository navigation
fix(server): update Chocolatey OpenCode on Windows - #9546
Baker-Harrison wants to merge 6 commits into
Conversation
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. |
|
Thanks for the PR. We're not taking changes to the orchestration and provider layers right now: that part of the server is being rewritten for V2, and merging into the current code would either conflict with or be thrown away by that work. Closing for now. If this is still an issue once V2 lands, please reopen (or open a fresh PR against the new code) and we'll take a proper look. |
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.