@hung319/opencode-qwen 1.1.7 → 1.1.8
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/dist/plugin.js +1 -1
- package/dist/qwen/token.js +2 -1
- package/package.json +1 -1
package/dist/plugin.js
CHANGED
|
@@ -397,7 +397,7 @@ export const createQwenPlugin = (id) => async ({ client, directory }) => {
|
|
|
397
397
|
try {
|
|
398
398
|
// Add timeout to prevent hanging during validation
|
|
399
399
|
const validationPromise = validateToken(token);
|
|
400
|
-
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error('Token validation timed out')), 15000));
|
|
400
|
+
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error('Token validation timed out after 15 seconds')), 15000));
|
|
401
401
|
const validation = await Promise.race([validationPromise, timeoutPromise]);
|
|
402
402
|
const email = validation.email || await promptEmail();
|
|
403
403
|
accounts.push({ apiKey: token, email });
|
package/dist/qwen/token.js
CHANGED
|
@@ -2,8 +2,9 @@ import { QWEN_CONSTANTS } from '../constants';
|
|
|
2
2
|
export async function validateToken(apiKey) {
|
|
3
3
|
// Validate using the validation endpoint to check if the token is valid and get user info
|
|
4
4
|
try {
|
|
5
|
+
// Use a shorter timeout as token validation should be fast
|
|
5
6
|
const validateController = new AbortController();
|
|
6
|
-
const validateTimeoutId = setTimeout(() => validateController.abort(),
|
|
7
|
+
const validateTimeoutId = setTimeout(() => validateController.abort(), 8000); // 8 second timeout
|
|
7
8
|
const validateResponse = await fetch(QWEN_CONSTANTS.VALIDATE_URL, {
|
|
8
9
|
method: 'POST',
|
|
9
10
|
headers: {
|
package/package.json
CHANGED