test: clarify manifest catalog alias planning

This commit is contained in:
Shakker
2026-04-29 09:28:09 +01:00
parent eb82694217
commit 4fbd683819
2 changed files with 39 additions and 0 deletions

View File

@@ -754,6 +754,8 @@ Top-level fields:
Alias targets must be top-level providers owned by the same plugin. When a
provider-filtered list uses an alias, OpenClaw can read the owning manifest and
apply alias API/base URL overrides without loading provider runtime.
Aliases do not expand unfiltered catalog listings; broad lists emit the owning
canonical provider rows only.
`suppressions` replaces the old provider runtime `suppressBuiltInModel` hook.
Suppression entries are honored only when the provider is owned by the plugin or

View File

@@ -143,6 +143,43 @@ describe("manifest model catalog planner", () => {
]);
});
it("keeps alias provider rows out of unfiltered broad planning", () => {
const plan = planManifestModelCatalogRows({
registry: {
plugins: [
{
id: "openai",
providers: ["openai"],
modelCatalog: {
aliases: {
"azure-openai-responses": {
provider: "openai",
api: "azure-openai-responses",
baseUrl: "https://example.openai.azure.com/openai/v1",
},
},
providers: {
openai: {
api: "openai-responses",
baseUrl: "https://api.openai.com/v1",
models: [{ id: "gpt-5.4", name: "GPT-5.4" }],
},
},
},
},
],
},
});
expect(plan.entries.map((entry) => entry.provider)).toEqual(["openai"]);
expect(plan.rows.map((row) => row.ref)).toEqual(["openai/gpt-5.4"]);
expect(plan.rows).not.toContainEqual(
expect.objectContaining({
provider: "azure-openai-responses",
}),
);
});
it("reports duplicate provider/model keys and excludes conflicted rows", () => {
const plan = planManifestModelCatalogRows({
registry: {