mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 06:20:04 +00:00
fix(cliproxy): guard against undefined catalog and add issueUrl field
- Add null check for catalog entries from Partial<Record> type - Include issueUrl in JSON output for broken model tracking Built [OnSteroids](https://onsteroids.ai)
This commit is contained in:
@@ -184,6 +184,7 @@ interface CatalogJsonModel {
|
|||||||
deprecated?: boolean;
|
deprecated?: boolean;
|
||||||
deprecationReason?: string;
|
deprecationReason?: string;
|
||||||
broken?: boolean;
|
broken?: boolean;
|
||||||
|
issueUrl?: string;
|
||||||
thinking?: ThinkingSupport;
|
thinking?: ThinkingSupport;
|
||||||
extendedContext?: boolean;
|
extendedContext?: boolean;
|
||||||
nativeImageInput?: boolean;
|
nativeImageInput?: boolean;
|
||||||
@@ -198,6 +199,9 @@ export function handleCatalogJson(): void {
|
|||||||
const catalogs = getAllResolvedCatalogs();
|
const catalogs = getAllResolvedCatalogs();
|
||||||
const result: Record<string, CatalogJsonModel[]> = {};
|
const result: Record<string, CatalogJsonModel[]> = {};
|
||||||
for (const [provider, catalog] of Object.entries(catalogs)) {
|
for (const [provider, catalog] of Object.entries(catalogs)) {
|
||||||
|
if (!catalog) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
result[provider] = catalog.models.map((m) => {
|
result[provider] = catalog.models.map((m) => {
|
||||||
const entry: CatalogJsonModel = { id: m.id, name: m.name };
|
const entry: CatalogJsonModel = { id: m.id, name: m.name };
|
||||||
if (m.tier !== undefined) entry.tier = m.tier;
|
if (m.tier !== undefined) entry.tier = m.tier;
|
||||||
@@ -205,6 +209,7 @@ export function handleCatalogJson(): void {
|
|||||||
if (m.deprecated !== undefined) entry.deprecated = m.deprecated;
|
if (m.deprecated !== undefined) entry.deprecated = m.deprecated;
|
||||||
if (m.deprecationReason !== undefined) entry.deprecationReason = m.deprecationReason;
|
if (m.deprecationReason !== undefined) entry.deprecationReason = m.deprecationReason;
|
||||||
if (m.broken !== undefined) entry.broken = m.broken;
|
if (m.broken !== undefined) entry.broken = m.broken;
|
||||||
|
if (m.issueUrl !== undefined) entry.issueUrl = m.issueUrl;
|
||||||
if (m.thinking !== undefined) entry.thinking = m.thinking;
|
if (m.thinking !== undefined) entry.thinking = m.thinking;
|
||||||
if (m.extendedContext !== undefined) entry.extendedContext = m.extendedContext;
|
if (m.extendedContext !== undefined) entry.extendedContext = m.extendedContext;
|
||||||
if (m.nativeImageInput !== undefined) entry.nativeImageInput = m.nativeImageInput;
|
if (m.nativeImageInput !== undefined) entry.nativeImageInput = m.nativeImageInput;
|
||||||
|
|||||||
Reference in New Issue
Block a user