From 0b5d54f2cb87fe3dfb1671e58e9d9a2706d15c40 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Mon, 9 Mar 2026 23:37:58 -0400 Subject: [PATCH] core: enable npm bin links on non-Windows platforms to allow plugin executables to work while keeping them disabled on Windows CI where symlink permissions are restricted --- packages/opencode/src/config/config.ts | 11 +---------- packages/opencode/src/npm/index.ts | 4 +++- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts index 4d7c3b054d..4be232350b 100644 --- a/packages/opencode/src/config/config.ts +++ b/packages/opencode/src/config/config.ts @@ -34,8 +34,6 @@ import { Account } from "@/account" import { ConfigPaths } from "./paths" import { Filesystem } from "@/util/filesystem" import { Npm } from "@/npm" -import { BunProc } from "@/bun" -import { proxied } from "@/util/proxied" export namespace Config { const ModelId = z.string().meta({ $ref: "https://models.dev/model-schema.json#/$defs/Model" }) @@ -289,14 +287,7 @@ export namespace Config { // Install any additional dependencies defined in the package.json // This allows local plugins and custom tools to use external packages - await BunProc.run( - [ - "install", - // TODO: get rid of this case (see: https://github.com/oven-sh/bun/issues/19936) - ...(proxied() || process.env.CI ? ["--no-cache"] : []), - ], - { cwd: dir }, - ).catch((err) => { + await Npm.install(dir).catch((err) => { log.warn("failed to install dependencies", { dir, error: err }) }) } diff --git a/packages/opencode/src/npm/index.ts b/packages/opencode/src/npm/index.ts index c03486a7ad..b3c83edd48 100644 --- a/packages/opencode/src/npm/index.ts +++ b/packages/opencode/src/npm/index.ts @@ -84,9 +84,11 @@ export namespace Npm { export async function install(dir: string) { log.info("installing dependencies", { dir }) + // Disable binLinks on Windows CI where symlink permissions are restricted + const isWindowsCI = process.platform === "win32" && process.env.CI const arb = new Arborist({ path: dir, - binLinks: false, + binLinks: !isWindowsCI, progress: false, savePrefix: "", })