From c0d3746497f403b1fa9331cdc6d24e26bccef5f5 Mon Sep 17 00:00:00 2001 From: Z User Date: Tue, 16 Jun 2026 02:35:30 +0000 Subject: [PATCH] fix: use GitHub API instead of curl binary for version check (#808) The curl installation method's latestImpl() spawned the curl binary to follow GitHub releases redirect. This fails silently (text() catches errors and returns empty string) when curl is not installed, producing a confusing 'failed to resolve latest version from GitHub releases redirect' error. Replace with GitHub REST API call (GET /repos/.../releases/latest) using the existing HttpClient, which is already available and doesn't depend on any external binary. Parse tag_name from the JSON response. Root cause of #808: v0.1.1 was released without the curl handler in latestImpl() at all, causing 'unsupported update channel: curl'. The handler was added in main but used the curl binary. This fix makes it robust by using HTTP. --- packages/opencode/src/installation/index.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/opencode/src/installation/index.ts b/packages/opencode/src/installation/index.ts index c21c3c17..a708f093 100644 --- a/packages/opencode/src/installation/index.ts +++ b/packages/opencode/src/installation/index.ts @@ -218,14 +218,17 @@ export const layer: Layer.Layer