@hung319/opencode-qwen 1.1.4 → 1.1.5
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/README.md +1 -1
- package/dist/plugin.js +11 -3
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/plugin.js
CHANGED
|
@@ -395,8 +395,11 @@ export const createQwenPlugin = (id) => async ({ client, directory }) => {
|
|
|
395
395
|
break;
|
|
396
396
|
}
|
|
397
397
|
try {
|
|
398
|
-
|
|
399
|
-
const
|
|
398
|
+
// Add timeout to prevent hanging during validation
|
|
399
|
+
const validationPromise = validateToken(token);
|
|
400
|
+
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error('Token validation timed out')), 15000));
|
|
401
|
+
const validation = await Promise.race([validationPromise, timeoutPromise]);
|
|
402
|
+
const email = validation.email || await promptEmail();
|
|
400
403
|
accounts.push({ apiKey: token, email });
|
|
401
404
|
const isFirstAccount = accounts.length === 1;
|
|
402
405
|
const am = await AccountManager.loadFromDisk(config.account_selection_strategy);
|
|
@@ -437,7 +440,12 @@ export const createQwenPlugin = (id) => async ({ client, directory }) => {
|
|
|
437
440
|
callback: async () => ({ type: 'failed' })
|
|
438
441
|
});
|
|
439
442
|
}
|
|
440
|
-
|
|
443
|
+
// Allow user to try another token instead of breaking completely
|
|
444
|
+
const addAnother = await promptAddAnotherAccount(accounts.length);
|
|
445
|
+
if (!addAnother) {
|
|
446
|
+
break;
|
|
447
|
+
}
|
|
448
|
+
continue; // Continue to ask for another token
|
|
441
449
|
}
|
|
442
450
|
}
|
|
443
451
|
const primary = accounts[0];
|
package/package.json
CHANGED