hedgequantx 2.7.49 → 2.7.50
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.
- package/package.json +1 -1
- package/src/pages/ai-agents.js +19 -11
package/package.json
CHANGED
package/src/pages/ai-agents.js
CHANGED
|
@@ -237,8 +237,19 @@ const handleCliProxyConnection = async (provider, config, boxWidth) => {
|
|
|
237
237
|
try { loginResult.childProcess.kill(); } catch (e) { /* ignore */ }
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
// Fetch models
|
|
241
|
-
|
|
240
|
+
// Fetch models from CLIProxy (retry a few times if needed)
|
|
241
|
+
let modelsResult = { success: false, models: [] };
|
|
242
|
+
const spinner = ora({ text: 'LOADING MODELS...', color: 'yellow' }).start();
|
|
243
|
+
|
|
244
|
+
for (let i = 0; i < 5; i++) {
|
|
245
|
+
modelsResult = await cliproxy.fetchProviderModels(provider.id);
|
|
246
|
+
if (modelsResult.success && modelsResult.models.length > 0) {
|
|
247
|
+
spinner.stop();
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
251
|
+
}
|
|
252
|
+
spinner.stop();
|
|
242
253
|
|
|
243
254
|
if (modelsResult.success && modelsResult.models.length > 0) {
|
|
244
255
|
const selectedModel = await selectModelFromList(provider, modelsResult.models, boxWidth);
|
|
@@ -254,18 +265,15 @@ const handleCliProxyConnection = async (provider, config, boxWidth) => {
|
|
|
254
265
|
await prompts.waitForEnter();
|
|
255
266
|
return true;
|
|
256
267
|
}
|
|
268
|
+
// User pressed B to go back - still save as connected but no model selected yet
|
|
269
|
+
return true;
|
|
257
270
|
}
|
|
258
271
|
|
|
259
|
-
// No models
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
modelId: null,
|
|
263
|
-
modelName: 'AUTO'
|
|
264
|
-
});
|
|
265
|
-
saveConfig(config);
|
|
266
|
-
console.log(chalk.green(`\n ✓ ${provider.name.toUpperCase()} CONNECTED (AUTO MODE)`));
|
|
272
|
+
// No models found - show error
|
|
273
|
+
console.log(chalk.red('\n NO MODELS AVAILABLE'));
|
|
274
|
+
console.log(chalk.gray(' TRY RECONNECTING OR USE API KEY'));
|
|
267
275
|
await prompts.waitForEnter();
|
|
268
|
-
return
|
|
276
|
+
return false;
|
|
269
277
|
};
|
|
270
278
|
|
|
271
279
|
/** Handle API Key connection */
|