From aa4b8692afc8ae68aebd8fcbc45685cb07b2c1c5 Mon Sep 17 00:00:00 2001 From: Yoahoug Date: Fri, 16 Jan 2026 17:37:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Codex=20OAuth=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=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 --- src/ui-modules/config-scanner.js | 25 +++++++++++++++++++++++++ static/app/upload-config-manager.js | 6 ++++++ 2 files changed, 31 insertions(+) diff --git a/src/ui-modules/config-scanner.js b/src/ui-modules/config-scanner.js index 4b04137..042740f 100644 --- a/src/ui-modules/config-scanner.js +++ b/src/ui-modules/config-scanner.js @@ -29,6 +29,7 @@ export async function scanConfigFiles(currentConfig, providerPoolManager) { addToUsedPaths(usedPaths, currentConfig.ANTIGRAVITY_OAUTH_CREDS_FILE_PATH); addToUsedPaths(usedPaths, currentConfig.IFLOW_TOKEN_FILE_PATH); addToUsedPaths(usedPaths, currentConfig.ORCHIDS_CREDS_FILE_PATH); + addToUsedPaths(usedPaths, currentConfig.CODEX_OAUTH_CREDS_FILE_PATH); // 使用最新的提供商池数据 let providerPools = currentConfig.providerPools; @@ -46,6 +47,7 @@ export async function scanConfigFiles(currentConfig, providerPoolManager) { addToUsedPaths(usedPaths, provider.ANTIGRAVITY_OAUTH_CREDS_FILE_PATH); addToUsedPaths(usedPaths, provider.IFLOW_TOKEN_FILE_PATH); addToUsedPaths(usedPaths, provider.ORCHIDS_CREDS_FILE_PATH); + addToUsedPaths(usedPaths, provider.CODEX_OAUTH_CREDS_FILE_PATH); } } } @@ -227,6 +229,17 @@ function getFileUsageInfo(relativePath, fileName, usedPaths, currentConfig) { }); } + if (currentConfig.CODEX_OAUTH_CREDS_FILE_PATH && + (pathsEqual(relativePath, currentConfig.CODEX_OAUTH_CREDS_FILE_PATH) || + pathsEqual(relativePath, currentConfig.CODEX_OAUTH_CREDS_FILE_PATH.replace(/\\/g, '/')))) { + usageInfo.usageType = 'main_config'; + usageInfo.usageDetails.push({ + type: 'Main Config', + location: 'Codex OAuth credentials file path', + configKey: 'CODEX_OAUTH_CREDS_FILE_PATH' + }); + } + // 检查提供商池中的使用情况 if (currentConfig.providerPools) { // 使用 flatMap 将双重循环优化为单层循环 O(n) @@ -309,6 +322,18 @@ function getFileUsageInfo(relativePath, fileName, usedPaths, currentConfig) { configKey: 'ORCHIDS_CREDS_FILE_PATH' }); } + + if (provider.CODEX_OAUTH_CREDS_FILE_PATH && + (pathsEqual(relativePath, provider.CODEX_OAUTH_CREDS_FILE_PATH) || + pathsEqual(relativePath, provider.CODEX_OAUTH_CREDS_FILE_PATH.replace(/\\/g, '/')))) { + providerUsages.push({ + type: 'Provider Pool', + location: `Codex OAuth credentials (node ${index + 1})`, + providerType: providerType, + providerIndex: index, + configKey: 'CODEX_OAUTH_CREDS_FILE_PATH' + }); + } if (providerUsages.length > 0) { usageInfo.usageType = 'provider_pool'; diff --git a/static/app/upload-config-manager.js b/static/app/upload-config-manager.js index 3fcf96d..6951dde 100644 --- a/static/app/upload-config-manager.js +++ b/static/app/upload-config-manager.js @@ -849,6 +849,12 @@ function detectProviderFromPath(filePath) { providerType: 'claude-orchids-oauth', displayName: 'Orchids OAuth', shortName: 'orchids-oauth' + }, + { + patterns: ['configs/codex/', '/codex/'], + providerType: 'openai-codex-oauth', + displayName: 'OpenAI Codex OAuth', + shortName: 'codex-oauth' } ];