mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:50:43 +00:00
test: clarify manifest catalog alias planning
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user