Configure: make model picker allowlist searchable

This commit is contained in:
Benjamin Jesuiter
2026-02-17 08:36:43 +01:00
parent 900b97e3c7
commit 01fcac0726
4 changed files with 12 additions and 5 deletions

View File

@@ -142,8 +142,10 @@ describe("promptModelAllowlist", () => {
await promptModelAllowlist({ config, prompter });
const options = multiselect.mock.calls[0]?.[0]?.options ?? [];
const call = multiselect.mock.calls[0]?.[0];
const options = call?.options ?? [];
expectRouterModelFiltering(options as Array<{ value: string }>);
expect(call?.searchable).toBe(true);
});
it("filters to allowed keys when provided", async () => {

View File

@@ -424,6 +424,7 @@ export async function promptModelAllowlist(params: {
message: params.message ?? "Models in /model picker (multi-select)",
options,
initialValues: initialKeys.length > 0 ? initialKeys : undefined,
searchable: true,
});
const selected = normalizeModelKeys(selection.map((value) => String(value)));
if (selected.length > 0) {