@hung319/opencode-qwen 1.1.8 → 1.1.9
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 +6 -8
- package/package.json +1 -1
package/dist/plugin.js
CHANGED
|
@@ -3,7 +3,7 @@ import { exec } from 'node:child_process';
|
|
|
3
3
|
import { AccountManager, generateAccountId } from './plugin/accounts';
|
|
4
4
|
import { accessTokenExpired } from './plugin/token';
|
|
5
5
|
import { refreshAccessToken } from './plugin/token';
|
|
6
|
-
import {
|
|
6
|
+
import { refreshToken } from './qwen/token';
|
|
7
7
|
import { getModels } from './qwen/models';
|
|
8
8
|
import { promptAddAnotherAccount, promptLoginMode, promptToken, promptEmail, } from './plugin/cli';
|
|
9
9
|
import { QWEN_CONSTANTS, applyThinkingConfig } from './constants';
|
|
@@ -395,11 +395,9 @@ export const createQwenPlugin = (id) => async ({ client, directory }) => {
|
|
|
395
395
|
break;
|
|
396
396
|
}
|
|
397
397
|
try {
|
|
398
|
-
//
|
|
399
|
-
|
|
400
|
-
const
|
|
401
|
-
const validation = await Promise.race([validationPromise, timeoutPromise]);
|
|
402
|
-
const email = validation.email || await promptEmail();
|
|
398
|
+
// Skip token validation and save the token directly
|
|
399
|
+
// Token will be validated later during actual API calls
|
|
400
|
+
const email = await promptEmail();
|
|
403
401
|
accounts.push({ apiKey: token, email });
|
|
404
402
|
const isFirstAccount = accounts.length === 1;
|
|
405
403
|
const am = await AccountManager.loadFromDisk(config.account_selection_strategy);
|
|
@@ -431,11 +429,11 @@ export const createQwenPlugin = (id) => async ({ client, directory }) => {
|
|
|
431
429
|
}
|
|
432
430
|
}
|
|
433
431
|
catch (error) {
|
|
434
|
-
console.error(`
|
|
432
|
+
console.error(`Error during token setup: ${error.message}`);
|
|
435
433
|
if (accounts.length === 0) {
|
|
436
434
|
return resolve({
|
|
437
435
|
url: '',
|
|
438
|
-
instructions: `
|
|
436
|
+
instructions: `Error during token setup: ${error.message}`,
|
|
439
437
|
method: 'auto',
|
|
440
438
|
callback: async () => ({ type: 'failed' })
|
|
441
439
|
});
|
package/package.json
CHANGED