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
- if (!config.currentEndpoint && config.endpoints.length > 0) {
326
- config.currentEndpoint = config.endpoints[0].id;
327
- const firstModel = config.endpoints[0].models.find((m) => m.enabled);
328
- if (firstModel) {
329
- config.currentModel = firstModel.id;
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orquesta-cli",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Orquesta CLI - AI-powered coding assistant with team collaboration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",