From f422a9feec051ef324fc894877280b59bc1cce28 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Thu, 20 Nov 2025 00:41:06 +0000 Subject: [PATCH] Fixed npm registry URL slash handling Co-authored-by: rekram1-node --- packages/opencode/src/installation/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/installation/index.ts b/packages/opencode/src/installation/index.ts index f4209e5b8de..aa51d737637 100644 --- a/packages/opencode/src/installation/index.ts +++ b/packages/opencode/src/installation/index.ts @@ -159,7 +159,12 @@ export namespace Installation { export async function latest() { const [major] = VERSION.split(".").map((x) => Number(x)) const channel = CHANNEL === "latest" ? `latest-${major}` : CHANNEL - return fetch(`https://registry.npmjs.org/opencode-ai/${channel}`) + + // Get npm registry and ensure it ends with slash + const registry = await Bun.$`npm config get registry`.text().then((t) => t.trim()) + const registryUrl = registry.endsWith("/") ? registry : `${registry}/` + + return fetch(`${registryUrl}opencode-ai/${channel}`) .then((res) => { if (!res.ok) throw new Error(res.statusText) return res.json()