fix: model picker allowlist fallbacks
This commit is contained in:
@@ -121,7 +121,7 @@ describe("directive behavior", () => {
|
||||
expect(runEmbeddedPiAgent).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
it("uses configured models when no allowlist is set", async () => {
|
||||
it("includes catalog models when no allowlist is set", async () => {
|
||||
await withTempHome(async (home) => {
|
||||
vi.mocked(runEmbeddedPiAgent).mockReset();
|
||||
vi.mocked(loadModelCatalog).mockResolvedValueOnce([
|
||||
@@ -153,7 +153,7 @@ describe("directive behavior", () => {
|
||||
expect(text).toContain("anthropic/claude-opus-4-5");
|
||||
expect(text).toContain("openai/gpt-4.1-mini");
|
||||
expect(text).toContain("minimax/MiniMax-M2.1");
|
||||
expect(text).not.toContain("xai/grok-4");
|
||||
expect(text).toContain("xai/grok-4");
|
||||
expect(runEmbeddedPiAgent).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -101,6 +101,13 @@ function buildModelPickerCatalog(params: {
|
||||
|
||||
const hasAllowlist = Object.keys(params.cfg.agents?.defaults?.models ?? {}).length > 0;
|
||||
if (!hasAllowlist) {
|
||||
for (const entry of params.allowedModelCatalog) {
|
||||
push({
|
||||
provider: entry.provider,
|
||||
id: entry.id ?? "",
|
||||
name: entry.name,
|
||||
});
|
||||
}
|
||||
for (const entry of buildConfiguredCatalog()) {
|
||||
push(entry);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user