Skip to content

Commit 3b1be8b

Browse files
committed
fix(server): providers behind one mise binary no longer share a latest version
mise command wrappers for codex, claude and grok are all symlinks to the mise binary, so their manual installer lookups were cached under the same "manual\0<installPath>" key. Whichever provider resolved first won, and Codex 0.167.0 was reported as behind Claude's 2.1.318. Keep the package name in the manual installer cache key.
1 parent 6577c6b commit 3b1be8b

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

‎packages/provider-core/src/server/maintenanceResolver.test.ts‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,31 @@ it.layer(
13211321
),
13221322
);
13231323

1324+
it.effect("keeps manual installer lookups apart for providers behind one executable", () =>
1325+
Effect.gen(function* () {
1326+
const capabilities = (packageName: string, version: string) =>
1327+
makeManualOnlyProviderMaintenanceCapabilities({
1328+
provider: driver("packageTool"),
1329+
packageName,
1330+
installPath: "/usr/bin/mise",
1331+
lookupLatestVersion: Effect.succeed(version),
1332+
});
1333+
1334+
expect(yield* resolveLatestProviderVersion(capabilities("@example/claude", "2.1.0"))).toBe(
1335+
"2.1.0",
1336+
);
1337+
expect(yield* resolveLatestProviderVersion(capabilities("@example/codex", "0.9.0"))).toBe(
1338+
"0.9.0",
1339+
);
1340+
}).pipe(
1341+
Effect.provide(ProviderLatestVersions.layer),
1342+
Effect.provideService(
1343+
HttpClient.HttpClient,
1344+
HttpClient.make(() => Effect.die("installer lookups should not fall back to npm")),
1345+
),
1346+
),
1347+
);
1348+
13241349
it.effect(
13251350
"refreshes installer versions without letting an older lookup overwrite the result",
13261351
() =>

‎packages/provider-core/src/server/maintenanceResolver.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,14 +978,16 @@ const fetchNpmLatestVersion = Effect.fn("fetchNpmLatestVersion")(function* (pack
978978
/**
979979
* The installer's own answer is cached apart from the npm registry entry. A
980980
* manual-only install has no command to key on, so its executable stands in.
981+
* One executable can front several providers (mise command wrappers all
982+
* resolve to the `mise` binary), so the package stays part of the key.
981983
*/
982984
function installerLatestVersionKey(capabilities: ProviderMaintenanceCapabilities) {
983985
if (!capabilities.lookupLatestVersion) return null;
984986
if (capabilities.latestVersionCacheKey) return capabilities.latestVersionCacheKey;
985987
const update = capabilities.update;
986988
if (update) return [update.lockKey, update.executable, ...update.args].join("\0");
987989
return capabilities.installPath
988-
? ["manual", capabilities.installPath].join("\0")
990+
? ["manual", capabilities.installPath, capabilities.packageName ?? ""].join("\0")
989991
: capabilities.packageName && `npm-registry\0${capabilities.packageName}`;
990992
}
991993

0 commit comments

Comments
 (0)