fix(cliproxy): preserve explicit false values in catalog --json

Use !== undefined checks instead of truthy checks so that explicitly
set false booleans (e.g. extendedContext: false) appear in JSON output,
allowing consumers to distinguish "not set" from "explicitly disabled".

Built [OnSteroids](https://onsteroids.ai)
This commit is contained in:
Sergey Galuza
2026-04-11 19:08:24 +02:00
parent 6fc22625ac
commit f5520de42a
+7 -7
View File
@@ -198,13 +198,13 @@ export function handleCatalogJson(): void {
for (const [provider, catalog] of Object.entries(catalogs)) {
result[provider] = catalog.models.map((m) => {
const entry: CatalogJsonModel = { id: m.id, name: m.name };
if (m.tier) entry.tier = m.tier;
if (m.description) entry.description = m.description;
if (m.deprecated) entry.deprecated = m.deprecated;
if (m.deprecationReason) entry.deprecationReason = m.deprecationReason;
if (m.broken) entry.broken = m.broken;
if (m.extendedContext) entry.extendedContext = m.extendedContext;
if (m.nativeImageInput) entry.nativeImageInput = m.nativeImageInput;
if (m.tier !== undefined) entry.tier = m.tier;
if (m.description !== undefined) entry.description = m.description;
if (m.deprecated !== undefined) entry.deprecated = m.deprecated;
if (m.deprecationReason !== undefined) entry.deprecationReason = m.deprecationReason;
if (m.broken !== undefined) entry.broken = m.broken;
if (m.extendedContext !== undefined) entry.extendedContext = m.extendedContext;
if (m.nativeImageInput !== undefined) entry.nativeImageInput = m.nativeImageInput;
return entry;
});
}