diff --git a/src/i18n/ja.ts b/src/i18n/ja.ts index 3e17b90..dab90d1 100644 --- a/src/i18n/ja.ts +++ b/src/i18n/ja.ts @@ -1061,11 +1061,12 @@ export const jaOverrides = { "agents.modify.description": "選択したモデルと認証方式を書き込み、無関係な設定を保持します。", "agents.modify.authApiKeyHint": "CPA の API を使用して接続し、より安定した接続状態を維持します。", "agents.nativeOAuth.status": "CPA 未接続", - "agents.nativeOAuth.restore": "接続設定を解除", - "agents.nativeOAuth.restoreHint": "CPA の接続設定を解除し、Codex で ChatGPT にログインできるようにします。Codex を再起動してログインした後、基本設定で OAuth を選び、設定を更新してください。", + "agents.nativeOAuth.restoreTitle": "ChatGPT App のログイン状態をリセット", + "agents.nativeOAuth.restore": "ログインをリセット", + "agents.nativeOAuth.restoreHint": "CPA の接続設定を解除し、Codex で ChatGPT アカウントへのログインを促します。変更を反映するには、解除後にアプリを再起動してください。", "agents.nativeOAuth.activeHint": "現在 CPA に接続していません。ログイン後に OAuth を選んで設定を更新すると、CPA に再接続できます。", - "agents.nativeOAuth.restored": "CPA の接続設定を解除しました。Codex を再起動して ChatGPT にログインし、基本設定で OAuth を選んで設定を更新してください。", - "agents.modify.authOAuthHint": "アカウントのログイン状態を保持して CPA 経由で接続します。未ログインの状態で API から切り替える場合は、設定管理で「接続設定を解除」をクリックし、Codex を再起動して ChatGPT にログインしてから選択してください。", + "agents.nativeOAuth.restored": "CPA の接続設定を解除しました。Codex を再起動して ChatGPT アカウントにログインしてください。", + "agents.modify.authOAuthHint": "アカウントのログイン状態を保持して CPA 経由で接続します。未ログインの状態で API から切り替える場合は、設定管理で「ログインをリセット」をクリックし、Codex を再起動して ChatGPT にログインしてから選択してください。", "agents.modify.authHelpLabel": "説明", "agents.modify.authHelpShow": "選び方", "agents.modify.authHelpHide": "説明を閉じる", @@ -1105,9 +1106,9 @@ export const jaOverrides = { 'agents.oauthLoginRequired.title': 'Codex へのログインが必要です', "agents.oauthLoginRequired.enableDescription": "利用可能な Codex のログイン情報が見つかりません。API から OAuth に切り替えるには、", "agents.oauthLoginRequired.enableManagementConnector": "で", - "agents.oauthLoginRequired.enableClearConfiguration": "接続設定を解除", + "agents.oauthLoginRequired.enableClearConfiguration": "ログインをリセット", "agents.oauthLoginRequired.enableDescriptionSuffix": "をクリックしてください。Codex を再起動して ChatGPT にログインした後、基本設定で OAuth を選んで設定を更新してください。", - "agents.oauthLoginRequired.applyDescription": "利用可能な Codex のログイン情報が見つかりません。設定管理で「接続設定を解除」をクリックし、Codex を再起動して ChatGPT にログインした後、基本設定で OAuth を選んで設定を更新してください。", + "agents.oauthLoginRequired.applyDescription": "利用可能な Codex のログイン情報が見つかりません。設定管理で「ログインをリセット」をクリックし、Codex を再起動して ChatGPT にログインした後、基本設定で OAuth を選んで設定を更新してください。", 'agents.oauthLoginRequired.launchDescription': '有効なログイン認証情報が見つからないため Codex を起動できません。先に Codex アプリで ChatGPT アカウントにログインしてください。', "agents.oauthLoginRequired.openManagement": "設定管理を開く", 'agents.oauthLoginRequired.confirm': '了解しました', @@ -1140,6 +1141,7 @@ export const jaOverrides = { 'agents.clear.confirm': '設定を消去', 'agents.clear.success': 'Codex 設定を消去しました。', 'agents.clearIntegration.title': '{name} の接続設定を解除', + 'agents.clearIntegration.button': '接続設定を解除', 'agents.clearIntegration.description': 'CPA 接続設定を削除し、その他の設定は保持します。解除後はエージェントを再起動してください。', 'agents.clearIntegration.confirm': '接続設定の解除を確認', 'agents.clearIntegration.success': 'CPA 接続設定を解除しました。{name} を再起動してください。', diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 2d2659c..c224738 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -1079,11 +1079,12 @@ export const en: Record = { "agents.modify.description": "Write the selected model and authentication settings while preserving unrelated settings.", "agents.modify.authApiKeyHint": "Connect using the CPA API for a more stable connection.", "agents.nativeOAuth.status": "CPA disconnected", - "agents.nativeOAuth.restore": "Clear integration", - "agents.nativeOAuth.restoreHint": "Clear the CPA integration so Codex can use ChatGPT sign-in. Restart Codex and sign in, then return to Basic configuration, select OAuth, and update the configuration.", + "agents.nativeOAuth.restoreTitle": "Reset ChatGPT App sign-in state", + "agents.nativeOAuth.restore": "Reset sign-in", + "agents.nativeOAuth.restoreHint": "Clear the CPA integration to prompt ChatGPT account sign-in in Codex. Restart the app afterward for the change to take effect.", "agents.nativeOAuth.activeHint": "CPA is disconnected. After signing in, select OAuth and update the configuration to reconnect through CPA.", - "agents.nativeOAuth.restored": "CPA integration cleared. Restart Codex and sign in to ChatGPT, then return to Basic configuration, select OAuth, and update the configuration.", - "agents.modify.authOAuthHint": "Connect through CPA while retaining your account sign-in. When switching from API mode without sign-in credentials, use Clear integration in Configuration management, restart Codex, and sign in to ChatGPT before selecting this mode.", + "agents.nativeOAuth.restored": "CPA integration cleared. Restart Codex and sign in to your ChatGPT account.", + "agents.modify.authOAuthHint": "Connect through CPA while retaining your account sign-in. When switching from API mode without sign-in credentials, use Reset sign-in in Configuration management, restart Codex, and sign in to ChatGPT before selecting this mode.", "agents.modify.authHelpLabel": "Details", "agents.modify.authHelpShow": "How to choose", "agents.modify.authHelpHide": "Hide details", @@ -1105,9 +1106,9 @@ export const en: Record = { 'agents.oauthLoginRequired.title': 'Codex sign-in required', "agents.oauthLoginRequired.enableDescription": "No usable Codex sign-in credentials were found. To switch from API mode to OAuth, open ", "agents.oauthLoginRequired.enableManagementConnector": " and click ", - "agents.oauthLoginRequired.enableClearConfiguration": "Clear integration", + "agents.oauthLoginRequired.enableClearConfiguration": "Reset sign-in", "agents.oauthLoginRequired.enableDescriptionSuffix": ". Restart Codex and sign in to ChatGPT, then return to Basic configuration, select OAuth, and update the configuration.", - "agents.oauthLoginRequired.applyDescription": "No usable Codex sign-in credentials were found. Open Configuration management and click Clear integration. Restart Codex and sign in to ChatGPT, then return to Basic configuration, select OAuth, and update the configuration.", + "agents.oauthLoginRequired.applyDescription": "No usable Codex sign-in credentials were found. Open Configuration management and click Reset sign-in. Restart Codex and sign in to ChatGPT, then return to Basic configuration, select OAuth, and update the configuration.", 'agents.oauthLoginRequired.launchDescription': 'Codex cannot be started because no valid sign-in credentials were found. Sign in to your ChatGPT account in the Codex app first.', "agents.oauthLoginRequired.openManagement": "Open configuration management", 'agents.oauthLoginRequired.confirm': 'Got it', @@ -1140,6 +1141,7 @@ export const en: Record = { 'agents.clear.confirm': 'Clear Configuration', 'agents.clear.success': 'The Codex configuration has been cleared.', 'agents.clearIntegration.title': 'Clear {name} integration', + 'agents.clearIntegration.button': 'Clear integration', 'agents.clearIntegration.description': 'Remove CPA integration settings and keep other settings. Restart the agent afterward.', 'agents.clearIntegration.confirm': 'Confirm clear integration', 'agents.clearIntegration.success': 'CPA integration cleared. Restart {name}.', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 50f3d45..176bf53 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -1078,11 +1078,12 @@ export const zhCN = { "agents.modify.description": "将所选模型和认证方式写入本机配置,保留无关设置。", "agents.modify.authApiKeyHint": "使用 CPA 的API接入,状态更稳定。", "agents.nativeOAuth.status": "未接入 CPA", - "agents.nativeOAuth.restore": "清除接入", - "agents.nativeOAuth.restoreHint": "清除 CPA 接入,让 Codex 使用 ChatGPT 登录。请重启 Codex 并登录账号,再回到基础配置选择 OAuth 登录方式并更新配置。", + "agents.nativeOAuth.restoreTitle": "重置 ChatGPT App 登录状态", + "agents.nativeOAuth.restore": "重置登录", + "agents.nativeOAuth.restoreHint": "清除 CPA 接入,触发 Codex 登录ChatGPT 账号,清除后重启软件生效。", "agents.nativeOAuth.activeHint": "当前未接入 CPA;登录后选择 OAuth 登录方式,更新配置将重新接入 CPA。", - "agents.nativeOAuth.restored": "已清除 CPA 接入。请重启 Codex 并登录 ChatGPT,再回到基础配置选择 OAuth 登录方式并更新配置。", - "agents.modify.authOAuthHint": "通过 CPA 接入并保留账号登录状态。从 API 切换且未登录时,先在配置管理中点击“清除接入”,重启 Codex 并登录 ChatGPT,再选择此方式。", + "agents.nativeOAuth.restored": "已清除 CPA 接入,请重启 Codex 并登录 ChatGPT 账号。", + "agents.modify.authOAuthHint": "通过 CPA 接入并保留账号登录状态。从 API 切换且未登录时,先在配置管理中点击“重置登录”,重启 Codex 并登录 ChatGPT,再选择此方式。", "agents.modify.authHelpLabel": "说明", "agents.modify.authHelpShow": "如何选择", "agents.modify.authHelpHide": "收起说明", @@ -1104,9 +1105,9 @@ export const zhCN = { 'agents.oauthLoginRequired.title': '需要登录 Codex', "agents.oauthLoginRequired.enableDescription": "未检测到可用的 Codex 登录凭据。从 API 切换到 OAuth 登录方式时,请先在", "agents.oauthLoginRequired.enableManagementConnector": "中点击", - "agents.oauthLoginRequired.enableClearConfiguration": "清除接入", + "agents.oauthLoginRequired.enableClearConfiguration": "重置登录", "agents.oauthLoginRequired.enableDescriptionSuffix": ",然后重启 Codex 并登录 ChatGPT。登录完成后,返回基础配置选择 OAuth 登录方式并更新配置。", - "agents.oauthLoginRequired.applyDescription": "未检测到可用的 Codex 登录凭据。请前往“配置管理”点击“清除接入”,重启 Codex 并登录 ChatGPT,再返回基础配置选择 OAuth 登录方式并更新配置。", + "agents.oauthLoginRequired.applyDescription": "未检测到可用的 Codex 登录凭据。请前往“配置管理”点击“重置登录”,重启 Codex 并登录 ChatGPT,再返回基础配置选择 OAuth 登录方式并更新配置。", 'agents.oauthLoginRequired.launchDescription': '无法启动 Codex:未检测到有效的登录凭据。请先在 Codex 应用中登录 ChatGPT 账号。', "agents.oauthLoginRequired.openManagement": "前往配置管理", 'agents.oauthLoginRequired.confirm': '我知道了', @@ -1139,6 +1140,7 @@ export const zhCN = { 'agents.clear.confirm': '确认清空配置', 'agents.clear.success': 'Codex 配置已清空。', 'agents.clearIntegration.title': '清除 {name} 接入', + 'agents.clearIntegration.button': '清除接入', 'agents.clearIntegration.description': '移除 CPA 接入配置并保留其他设置。清除后请重启智能体。', 'agents.clearIntegration.confirm': '确认清除接入', 'agents.clearIntegration.success': '已清除 CPA 接入,请重启 {name}。', diff --git a/src/pages/AgentControls.tsx b/src/pages/AgentControls.tsx index 79a9840..a8a16ad 100644 --- a/src/pages/AgentControls.tsx +++ b/src/pages/AgentControls.tsx @@ -103,7 +103,7 @@ export function AgentConfigManagementPanel({ : null} {codex ?
-

{t('agents.nativeOAuth.restore')}

{t('agents.nativeOAuth.restoreHint')}

+

{t('agents.nativeOAuth.restoreTitle')}

{t('agents.nativeOAuth.restoreHint')}

: null} {!pi ?
-

{t(codex ? 'agents.modify.clear' : 'agents.nativeOAuth.restore')}

{t(codex ? 'agents.management.clearDescription' : 'agents.clearIntegration.description')}

+

{t(codex ? 'agents.modify.clear' : 'agents.clearIntegration.button')}

{t(codex ? 'agents.management.clearDescription' : 'agents.clearIntegration.description')}

- +
: null} {pi ?
diff --git a/tests/agent-native-oauth-ui.cjs b/tests/agent-native-oauth-ui.cjs index 7426c17..eb512a6 100644 --- a/tests/agent-native-oauth-ui.cjs +++ b/tests/agent-native-oauth-ui.cjs @@ -11,7 +11,7 @@ const base = 'http://127.0.0.1:1421'; await page.route('**/*', route => route.request().url().startsWith(base + '/') ? route.continue() : route.abort()); const errors = []; page.on('pageerror', error => errors.push(String(error))); - const restore = () => page.getByRole('button', { name: '清除接入', exact: true }); + const restore = () => page.getByRole('button', { name: '重置登录', exact: true }); const update = () => page.locator('.agent-save-actions .primary-button'); const core = () => page.getByRole('tab', { name: '基础配置', exact: true }).click(); const manage = () => page.getByRole('tab', { name: '配置管理', exact: true }).click(); @@ -187,7 +187,7 @@ const base = 'http://127.0.0.1:1421'; await oauth().click(); const dialog = page.getByRole('alertdialog'); await dialog.waitFor(); - assert.match(await dialog.innerText(), /配置管理.*清除接入/); + assert.match(await dialog.innerText(), /配置管理.*重置登录/); assert.equal((await dialog.innerText()).includes('清空配置'), false); assert.equal(await page.getByRole('radio', { name: 'API 密钥', exact: true }).getAttribute('aria-checked'), 'true'); assert.equal((await page.evaluate(() => window.fixtureCalls)).filter(call => ['restore_codex_official_config', 'clear_codex_config', 'update_agent_config'].includes(call.cmd)).length, 0); @@ -218,11 +218,11 @@ const base = 'http://127.0.0.1:1421'; assert.equal(await close().count(), 1, 'Other managed clients can also close configuration'); assert.equal(await restore().count(), 0); await manage(); - assert.equal(await restore().count(), 1, 'Other clients can clear CPA integration in management'); + assert.equal(await page.getByRole('button', { name: '清除接入', exact: true }).count(), 1, 'Other clients can clear CPA integration in management'); assert.equal(await page.locator('#agent-clear-integration').count(), 0, 'The official Codex login action remains Codex-only'); } assert.deepEqual(errors, []); - console.log('PASS: Clear integration in management, missing-login guidance and navigation, login then OAuth reconnect, independent Close/Update, failures, and both layouts at 1280/360px.'); + console.log('PASS: Reset sign-in in management, missing-login guidance and navigation, login then OAuth reconnect, independent Close/Update, failures, and both layouts at 1280/360px.'); } finally { await browser.close(); } })().catch(error => { console.error(error); process.exitCode = 1; });