@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 CHANGED
@@ -26,7 +26,7 @@ Or add to your `opencode.json` with specific version:
26
26
 
27
27
  ```json
28
28
  {
29
- "plugin": ["@hung319/opencode-qwen@1.1.3"]
29
+ "plugin": ["@hung319/opencode-qwen@1.1.5"]
30
30
  }
31
31
  ```
32
32
 
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
- const validation = await validateToken(token);
399
- const email = await promptEmail();
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
- break;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hung319/opencode-qwen",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "OpenCode plugin for Qwen API providing access to Qwen AI models with auto-config and token management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",