@devries-cameron20 / t3code-1 / commits / 762813c171
Fork 0

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

fix(providers): respect mise ownership in native install locations (#19157)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

Taissa committed Oct 20, 2026 at 06:17 UTC 762813c171d30936759745a44e5ed0c814b7f1d2
2 files changed +44 -1
packages/provider-core/src/server/maintenanceResolver.test.ts
+37
@@ -759,6 +759,43 @@ it.layer(NodeServices.layer)("providerMaintenance", (it) => {
759 }),
760 );
761
762 + it.effect.each(["wrapper", "symlink"])(
763 + "keeps a mise-owned %s in a native install location manual-only",
764 + (launcher, { skip }) => {
765 + if (windowsHost || (launcher === "symlink" && !symlinksSupported)) skip();
766 + return Effect.gen(function* () {
767 + const tempDir = yield* makeTempDir("t3-native-mise");
768 + const nativePath = NodePath.join(tempDir, ".local", "bin", "native-package-tool");
769 + if (launcher === "wrapper") {
770 + writeExecutable(nativePath);
771 + NodeFS.writeFileSync(
772 + nativePath,
773 + '#!/bin/sh\nexec mise x native-package-tool -- native-package-tool "$@"\n',
774 + );
775 + } else {
776 + const target = NodePath.join(
777 + tempDir,
778 + "mise",
779 + "installs",
780 + "native-package-tool",
781 + "1.0.0",
782 + "native-package-tool",
783 + );
784 + writeExecutable(target);
785 + NodeFS.mkdirSync(NodePath.dirname(nativePath), { recursive: true });
786 + NodeFS.symlinkSync(target, nativePath);
787 + }
788 +
789 + const capabilities = yield* resolveProviderMaintenanceCapabilitiesEffect(
790 + nativePackageToolUpdate,
791 + { binaryPath: nativePath, env: { PATH: "" } },
792 + ).pipe(Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, noSpawn));
793 +
794 + expect(capabilities.update).toBeNull();
795 + });
796 + },
797 + );
798 +
799 it.effect.skipIf(windowsHost)("runs an explicit native updater outside PATH", () =>
800 Effect.gen(function* () {
801 const tempDir = yield* makeTempDir("t3-native-update");
packages/provider-core/src/server/maintenanceResolver.ts
+7 -1
@@ -456,7 +456,13 @@ export const resolvePackageManagedProviderMaintenance = Effect.fn(
456 ...(nativeUpdate.env ? { env: nativeUpdate.env } : {}),
457 })
458 : manual;
459 - if (nativeUpdate?.isCommandPath && commandPaths.some(nativeUpdate.isCommandPath)) {
459 + // A native-looking launcher can still delegate to a mise-owned install.
460 + if (
461 + nativeUpdate?.isCommandPath &&
462 + commandPaths.some(nativeUpdate.isCommandPath) &&
463 + !commandPaths.some(isMiseCommandPath) &&
464 + !(yield* isMiseWrapperScript(context))
465 + ) {
466 return native;
467 }
468 // A `node_modules` path not proven below belongs to another package or a