@devries-cameron20 / t3code-1 / commits / 6f4bc77abf
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(provider-core): npm-installed Claude in ~/.local gets npm updates (#27957)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Nov 2, 2026 at 18:51 UTC 6f4bc77abf0b92b095cc7640261af30ddd61093c
2 files changed +30 -1
packages/provider-core/src/server/maintenanceResolver.test.ts
+28
@@ -1132,6 +1132,34 @@ it.layer(
1132 },
1133 );
1134
1135 + it.effect.skipIf(!symlinksSupported || windowsHost)(
1136 + "updates an npm-owned launcher in a native install location with npm",
1137 + () =>
1138 + Effect.gen(function* () {
1139 + const tempDir = yield* makeTempDir("t3-native-npm");
1140 + const prefix = NodePath.join(tempDir, ".local");
1141 + const packageBin = NodePath.join("node_modules", "@example", "native-package-tool", "bin");
1142 + writeExecutable(NodePath.join(prefix, "lib", packageBin, "native-package-tool.exe"));
1143 + const launcher = NodePath.join(prefix, "bin", "native-package-tool");
1144 + NodeFS.mkdirSync(NodePath.dirname(launcher), { recursive: true });
1145 + NodeFS.symlinkSync(
1146 + NodePath.join("..", "lib", packageBin, "native-package-tool.exe"),
1147 + launcher,
1148 + );
1149 +
1150 + const capabilities = yield* resolveProviderMaintenanceCapabilitiesEffect(
1151 + nativePackageToolUpdate,
1152 + { binaryPath: launcher, env: { PATH: "" } },
1153 + ).pipe(Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, noSpawn));
1154 +
1155 + expect(capabilities.update).toMatchObject({
1156 + executable: "npm",
1157 + args: expect.arrayContaining(["--prefix", prefix]),
1158 + lockKey: `npm-global:${normalizeCommandPath(prefix)}`,
1159 + });
1160 + }),
1161 + );
1162 +
1163 it.effect.skipIf(!symlinksSupported)(
1164 "prefers npm ownership over the Node keg the package lives under",
1165 () =>
packages/provider-core/src/server/maintenanceResolver.ts
+2 -1
@@ -532,10 +532,11 @@ export const resolvePackageManagedProviderMaintenance = Effect.fn(
532 : {}),
533 })
534 : manual;
535 - // A native-looking launcher can still delegate to a mise-owned install.
535 + // A native-looking launcher can still delegate to an npm- or mise-owned install.
536 if (
537 nativeUpdate?.isCommandPath &&
538 commandPaths.some(nativeUpdate.isCommandPath) &&
539 + !npmGlobalPrefixFromCommandPath(context.realCommandPath, packageName) &&
540 !commandPaths.some(isMiseCommandPath) &&
541 !(yield* isMiseWrapperScript(context))
542 ) {