From 4d6e2d8efc483796c02738dca5827a776acbb152 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Wed, 29 Oct 2025 11:53:25 -0400 Subject: [PATCH] autoupgrade latest major only --- packages/opencode/src/installation/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/installation/index.ts b/packages/opencode/src/installation/index.ts index 19c6674c..f2df5b40 100644 --- a/packages/opencode/src/installation/index.ts +++ b/packages/opencode/src/installation/index.ts @@ -142,7 +142,9 @@ export namespace Installation { export const USER_AGENT = `opencode/${CHANNEL}/${VERSION}` export async function latest() { - return fetch(`https://registry.npmjs.org/opencode-ai/${CHANNEL}`) + const [major] = VERSION.split(".").map((x) => Number(x)) + const channel = CHANNEL === "latest" ? `latest-${major}` : CHANNEL + return fetch(`https://registry.npmjs.org/opencode-ai/${channel}`) .then((res) => { if (!res.ok) throw new Error(res.statusText) return res.json()