@@ -5,7 +5,11 @@ import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js";
|
5 | 5 | import { resolveConfiguredEntries } from "./list.configured.js"; |
6 | 6 | import { formatErrorWithStack } from "./list.errors.js"; |
7 | 7 | import { loadListModelRegistry } from "./list.registry-load.js"; |
8 | | -import { appendAllModelRowSources, appendConfiguredModelRowSources } from "./list.row-sources.js"; |
| 8 | +import { |
| 9 | +appendAllModelRowSources, |
| 10 | +appendConfiguredModelRowSources, |
| 11 | +modelRowSourcesRequireRegistry, |
| 12 | +} from "./list.row-sources.js"; |
9 | 13 | import { printModelTable } from "./list.table.js"; |
10 | 14 | import type { ModelRow } from "./list.types.js"; |
11 | 15 | import { loadModelsConfigWithSource } from "./load-config.js"; |
@@ -55,8 +59,12 @@ export async function modelsListCommand(
|
55 | 59 | let availableKeys: Set<string> | undefined; |
56 | 60 | let availabilityErrorMessage: string | undefined; |
57 | 61 | const useProviderCatalogFastPath = Boolean(opts.all && providerFilter === "codex"); |
| 62 | +const shouldLoadRegistry = modelRowSourcesRequireRegistry({ |
| 63 | +all: opts.all, |
| 64 | + useProviderCatalogFastPath, |
| 65 | +}); |
58 | 66 | try { |
59 | | -if (!useProviderCatalogFastPath) { |
| 67 | +if (shouldLoadRegistry) { |
60 | 68 | const loaded = await loadListModelRegistry(cfg, { providerFilter }); |
61 | 69 | modelRegistry = loaded.registry; |
62 | 70 | discoveredKeys = loaded.discoveredKeys; |
|