fix: preserve LM Studio quant model refs (#71486)

This commit is contained in:
Peter Steinberger
2026-04-26 01:30:22 +01:00
parent 5bb78ea7ed
commit 753ccf615c
5 changed files with 89 additions and 2 deletions

View File

@@ -1321,6 +1321,52 @@ describe("resolvePluginProviders", () => {
expectModelOwningPluginIds("gpt-5.4", ["workspace-openai"]);
});
it("preserves LM Studio @iq* quant suffixes when resolving model-owned provider plugins", () => {
setManifestPlugins([
createManifestProviderPlugin({
id: "lmstudio",
providerIds: ["lmstudio"],
modelSupport: {
modelPatterns: ["^qwen3\\.6-27b@iq3_xxs$"],
},
}),
]);
const provider: ProviderPlugin = {
id: "lmstudio",
label: "LM Studio",
auth: [],
};
const registry = createEmptyPluginRegistry();
registry.providers.push({ pluginId: "lmstudio", provider, source: "bundled" });
resolveRuntimePluginRegistryMock.mockReturnValue(registry);
expectModelOwningPluginIds("qwen3.6-27b@iq3_xxs", ["lmstudio"]);
expectModelOwningPluginIds("qwen3.6-27b", undefined);
const providers = resolvePluginProviders({
config: {},
modelRefs: ["qwen3.6-27b@iq3_xxs"],
bundledProviderAllowlistCompat: true,
});
expectResolvedProviders(providers, [
{ id: "lmstudio", label: "LM Studio", auth: [], pluginId: "lmstudio" },
]);
expect(resolveRuntimePluginRegistryMock).toHaveBeenCalledWith(
expect.objectContaining({
onlyPluginIds: ["lmstudio"],
config: expect.objectContaining({
plugins: expect.objectContaining({
allow: ["lmstudio"],
entries: {
lmstudio: { enabled: true },
},
}),
}),
}),
);
});
it("auto-loads a model-owned provider plugin from shorthand model refs", () => {
setManifestPlugins([
createManifestProviderPlugin({