Repository navigation
Conversation
…ement On Windows, the 'curl' upgrade method runs a bash install script that tries to mv the new binary over the running one. Windows locks running executables, so the mv fails silently and the upgrade reports success without actually replacing the binary. This fix adds a Windows-specific upgrade path that: 1. Downloads the zip using curl.exe 2. Extracts it to a temp directory 3. Renames the current binary to .old 4. Spawns a background batch script that waits for the process to exit, then replaces the binary and cleans up The batch script retries the move in a loop, so it handles both cases: - User exits opencode normally - User is still in the session (waits until they exit)
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #37055
Type of change
What does this PR do?
opencode upgradeuses thecurlmethod which runs a bash install script fromhttps://opencode.ai/install. This script downloads the new binary and tries tomvit over the running one. Windows locks running executables, so themvfails silently and the upgrade reports success without actually replacing the binary.This fix adds a Windows-specific upgrade path (
upgradeCurlWindows) that:curl.exedirectly.oldThe batch script retries the
movein a loop, so it handles both normal exit and cases where the user stays in the session longer.How did you verify your code works?
opencode upgrade, confirmed it downloads and extracts the new versionopencode --versionto confirm new versionScreenshots / recordings
N/A - CLI change, no UI modification.
Checklist