From 02ceb2158c3d6c2458fc68a3db1d467d055eeebd Mon Sep 17 00:00:00 2001 From: hex2077 Date: Wed, 10 Jun 2026 01:05:08 +0800 Subject: [PATCH] =?UTF-8?q?refactor(auth/codex-oauth):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96Codex=E4=BB=A4=E7=89=8C=E6=89=B9=E9=87=8F=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E7=9A=84=E8=87=AA=E5=8A=A8=E5=85=B3=E8=81=94=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整自动关联逻辑的执行时机,从单token导入后改为批量完成后统一调用 为自动关联添加异常捕获,避免失败中断批量导入流程 升级项目版本至3.2.4.1 --- VERSION | 2 +- src/auth/codex-oauth.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 9b7a431..98e2229 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.4 \ No newline at end of file +3.2.4.1 \ No newline at end of file diff --git a/src/auth/codex-oauth.js b/src/auth/codex-oauth.js index 655a67b..096b72f 100644 --- a/src/auth/codex-oauth.js +++ b/src/auth/codex-oauth.js @@ -813,12 +813,6 @@ export async function batchImportCodexTokensStream(tokens, onProgress = null, sk }; results.success++; - // 自动关联到 Pools - await autoLinkProviderConfigs(CONFIG, { - onlyCurrentCred: true, - credPath: relativePath - }); - } catch (error) { logger.error(`${CODEX_OAUTH_CONFIG.logPrefix} Token ${i + 1} import failed:`, error.message); @@ -844,6 +838,12 @@ export async function batchImportCodexTokensStream(tokens, onProgress = null, sk } if (results.success > 0) { + try { + await autoLinkProviderConfigs(CONFIG); + } catch (linkError) { + logger.error(`${CODEX_OAUTH_CONFIG.logPrefix} Failed to auto-link imported tokens:`, linkError.message); + } + broadcastEvent('oauth_batch_success', { provider: 'openai-codex-oauth', count: results.success,