orquesta-cli 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -322,11 +322,22 @@ export class ConfigManager {
|
|
|
322
322
|
added++;
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
|
|
325
|
+
const currentExists = !!config.currentEndpoint && config.endpoints.some((e) => e.id === config.currentEndpoint);
|
|
326
|
+
if (!currentExists && config.endpoints.length > 0) {
|
|
327
|
+
const fallback = config.endpoints.find((e) => e.provider === 'batuta' || e.id === 'batuta-proxy') ||
|
|
328
|
+
config.endpoints[0];
|
|
329
|
+
config.currentEndpoint = fallback.id;
|
|
330
|
+
const enabledModel = fallback.models.find((m) => m.enabled) || fallback.models[0];
|
|
331
|
+
if (enabledModel)
|
|
332
|
+
config.currentModel = enabledModel.id;
|
|
333
|
+
}
|
|
334
|
+
else if (currentExists) {
|
|
335
|
+
const ep = config.endpoints.find((e) => e.id === config.currentEndpoint);
|
|
336
|
+
const modelExists = ep.models.some((m) => m.id === config.currentModel);
|
|
337
|
+
if (!modelExists) {
|
|
338
|
+
const enabledModel = ep.models.find((m) => m.enabled) || ep.models[0];
|
|
339
|
+
if (enabledModel)
|
|
340
|
+
config.currentModel = enabledModel.id;
|
|
330
341
|
}
|
|
331
342
|
}
|
|
332
343
|
await this.saveConfig();
|