From 8d09157569c3a6e1d3ea67fa968dce9e511e80a2 Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Wed, 14 Oct 2026 06:21:01 +0000 Subject: [PATCH] fix(cli): keep the npm install's on-disk plugin bootstrap An npm install sets CLINE_WRAPPER_PATH and ships the SDK and its other packages beside the binary, and standalone plugins rely on that host lookup (for example importing yaml without node_modules of their own). Only standalone binaries, which have none of that on disk, switch to the embedded worker. --- apps/cli/src/index.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/cli/src/index.ts b/apps/cli/src/index.ts index 9bec1d0290..3a755697e3 100755 --- a/apps/cli/src/index.ts +++ b/apps/cli/src/index.ts @@ -24,12 +24,15 @@ import { writeErr } from "./utils/output"; declare const CLINE_PLUGIN_WORKER_PATH: string | undefined; -// Compiled executables run plugins in their embedded worker, which serves the -// SDK from this build. Override any bootstrap a parent process configured: the -// Hub daemon and SSH remotes run this binary with no plugin files beside it. -// The subprocess sandbox spawns a separate runtime that cannot read it. +// Standalone compiled executables (the desktop's Hub, SSH remotes) have no +// plugin files beside them, so plugins run in the embedded worker, which serves +// the SDK from this build; override any bootstrap a parent configured. An npm +// install (CLINE_WRAPPER_PATH) keeps its on-disk bootstrap, whose host lookup +// also gives standalone plugins the install's other packages. The subprocess +// sandbox spawns a separate runtime that cannot read the embedded worker. if ( typeof CLINE_PLUGIN_WORKER_PATH === "string" && + !process.env.CLINE_WRAPPER_PATH && process.env.CLINE_PLUGIN_MODE !== "sandbox" ) { process.env.CLINE_PLUGIN_BOOTSTRAP_PATH = CLINE_PLUGIN_WORKER_PATH;