Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(desktop): Codex 远端 401 不再走 CC/XD 静默重试,直接显「同步登录态」 (#685)
yan6c60e6f45be9
diff --git a/apps/desktop/src/main/__tests__/makerEventHotPathOrdering.test.ts b/apps/desktop/src/main/__tests__/makerEventHotPathOrdering.test.tsindex 9599dded5d..4ea2e51add 100644--- a/apps/desktop/src/main/__tests__/makerEventHotPathOrdering.test.ts+++ b/apps/desktop/src/main/__tests__/makerEventHotPathOrdering.test.ts@@ -50,6 +50,7 @@ describe('maker:event hot path ordering', () => {)?.[0];expect(source).toContain('function isRemoteAuthRetryErrorEvent(');+ expect(source).toContain("if (session.agentKind === 'codex') return false;");expect(source).toContain('service.deferRemoteAuthRetryError(meta, event);');expect(wireSessionSource).toContain('isRemoteAuthRetry = isRemoteAuthRetryErrorEvent(session, event);');expect(deferredHandler).toBeTruthy();diff --git a/apps/desktop/src/main/maker-ipc/register.ts b/apps/desktop/src/main/maker-ipc/register.tsindex aca52f978a..87849c58e7 100644--- a/apps/desktop/src/main/maker-ipc/register.ts+++ b/apps/desktop/src/main/maker-ipc/register.ts@@ -1842,10 +1842,11 @@ function handleAgentIslandEventAfterBroadcast(}function isRemoteAuthRetryErrorEvent(- session: { remoteHostId?: unknown },+ session: { agentKind?: unknown; remoteHostId?: unknown },event: AgentEvent,): boolean {if (!session.remoteHostId || event.type !== 'error' || !isTerminalTurnErrorEvent(event)) return false;+ if (session.agentKind === 'codex') return false;const data = event.data as { message?: unknown; sdkError?: unknown; errorStatus?: unknown } | undefined;return data?.sdkError === 'authentication_failed' ||data?.errorStatus === 401 ||@@ -2469,7 +2470,7 @@ export function wireSessionToIpc(session: ReturnType<Maker['getSession']>): voidisPlannedUpgradeClose =errData?.reason === 'remote_daemon_closed' &&isCcMgrUpgradeInFlight(session.id);- // 远程 auth 错误跳过持久化:renderer 会静默 auto-retry(makerChatStore 在 reducer+ // Legacy CC/XD 远程 auth 错误跳过持久化:renderer 会静默 auto-retry(makerChatStore 在 reducer// 前拦截、关闭旧会话、重发消息,不显示 ErrorBanner);若 main 已落库,retry 成功后// 重开会话会看到虚假错误卡。判定与 renderer 的 isAuthError 保持一致,覆盖// sdkError === 'authentication_failed' 以及 message 命中 authentication_error /diff --git a/apps/desktop/src/renderer/__tests__/makerChatStoreTextDeltaBatching.test.ts b/apps/desktop/src/renderer/__tests__/makerChatStoreTextDeltaBatching.test.tsindex 735f34d4a8..93a86ea747 100644--- a/apps/desktop/src/renderer/__tests__/makerChatStoreTextDeltaBatching.test.ts+++ b/apps/desktop/src/renderer/__tests__/makerChatStoreTextDeltaBatching.test.ts@@ -1255,7 +1255,7 @@ describe('makerChatStore text delta batching', () => {);});- it('persists the original remote auth error when retry enqueue rejects asynchronously', async () => {+ it('does not run the legacy remote auth retry path for Codex auth errors', async () => {vi.mocked(sessionService.get).mockResolvedValue({agentKind: 'codex',remoteHostId: 'remote-host',@@ -1268,7 +1268,55 @@ describe('makerChatStore text delta batching', () => {model: MODEL,effort: EFFORT,permissionMode: PERMISSION_MODE,- } as Awaited<ReturnType<typeof sessionService.get>>);+ } as unknown as Awaited<ReturnType<typeof sessionService.get>>);+ makerChatStore.ensureInitialMessages(SESSION_ID);+ await flushPromises();+ emitDbMessageCreated({+ id: 'user-row',+ clientId: 'user-client',+ role: 'user',+ content: 'show sync auth',+ createdAt: '2026-01-01T00:00:01.000Z',+ });++ onEvent?.({+ sessionId: SESSION_ID,+ event: {+ type: 'error',+ source: 'codex',+ data: { errorStatus: 401, message: 'Authorization: [REDACTED]' },+ // 真实 Codex 事件没有 agentMeta(SDK 无 uuid 概念)——不注入合成值,+ // 正好覆盖双写修复:renderer 不再 deferred 补落,main 热路径唯一落库。+ agentMeta: null,+ },+ });+ await flushPromises();++ expect(window.electronAPI.safeStorageRead).not.toHaveBeenCalled();+ expect(window.electronAPI.maker.closeSession).not.toHaveBeenCalled();+ expect(input.enqueue).not.toHaveBeenCalled();+ // main 侧 isRemoteAuthRetryErrorEvent 对 codex 返回 false,error 行走正常+ // onTurnErrorEvent 落库;renderer 再 deferred 会双写(dedup key 对不上)。+ expect(input.persistTurnErrorDeferred).not.toHaveBeenCalled();+ expect(makerChatStore.getSnapshot(SESSION_ID).error).toBe(+ 'Authorization: [REDACTED] (HTTP 401)',+ );+ });++ it('persists the original remote auth error when retry enqueue rejects asynchronously', async () => {+ vi.mocked(sessionService.get).mockResolvedValue({+ agentKind: 'cc',+ remoteHostId: 'remote-host',+ sdkSessionId: null,+ fastMode: false,+ contextTokens: 0,+ contextWindow: 0,+ totalCostUsd: 0,+ workingDir: WORKING_DIR,+ model: MODEL,+ effort: EFFORT,+ permissionMode: PERMISSION_MODE,+ } as unknown as Awaited<ReturnType<typeof sessionService.get>>);makerChatStore.ensureInitialMessages(SESSION_ID);await flushPromises();emitDbMessageCreated({@@ -1284,7 +1332,7 @@ describe('makerChatStore text delta batching', () => {sessionId: SESSION_ID,event: {type: 'error',- source: 'codex',+ source: 'claude-code',data: { errorStatus: 401, message: 'Authorization: [REDACTED]' },agentMeta: { sdkSessionId: 'sdk-1' },},@@ -1302,7 +1350,7 @@ describe('makerChatStore text delta batching', () => {it('persists the original remote auth error when an accepted retry returns a projection error', async () => {vi.mocked(sessionService.get).mockResolvedValue({- agentKind: 'codex',+ agentKind: 'cc',remoteHostId: 'remote-host',sdkSessionId: null,fastMode: false,@@ -1313,7 +1361,7 @@ describe('makerChatStore text delta batching', () => {model: MODEL,effort: EFFORT,permissionMode: PERMISSION_MODE,- } as Awaited<ReturnType<typeof sessionService.get>>);+ } as unknown as Awaited<ReturnType<typeof sessionService.get>>);makerChatStore.ensureInitialMessages(SESSION_ID);await flushPromises();emitDbMessageCreated({@@ -1335,7 +1383,7 @@ describe('makerChatStore text delta batching', () => {sessionId: SESSION_ID,event: {type: 'error',- source: 'codex',+ source: 'claude-code',data: { sdkError: 'authentication_failed', message: '401 expired' },agentMeta: { sdkSessionId: 'sdk-1' },},@@ -1362,7 +1410,7 @@ describe('makerChatStore text delta batching', () => {},];vi.mocked(sessionService.get).mockResolvedValue({- agentKind: 'codex',+ agentKind: 'cc',remoteHostId: 'remote-host',sdkSessionId: null,fastMode: false,@@ -1373,7 +1421,7 @@ describe('makerChatStore text delta batching', () => {model: MODEL,effort: EFFORT,permissionMode: PERMISSION_MODE,- } as Awaited<ReturnType<typeof sessionService.get>>);+ } as unknown as Awaited<ReturnType<typeof sessionService.get>>);makerChatStore.ensureInitialMessages(SESSION_ID);await flushPromises();input.enqueue.mockImplementationOnce(async (sessionId: string) => projection(sessionId));@@ -1398,7 +1446,7 @@ describe('makerChatStore text delta batching', () => {sessionId: SESSION_ID,event: {type: 'error',- source: 'codex',+ source: 'claude-code',data: { sdkError: 'authentication_failed', message: '401 expired' },},});@@ -2448,7 +2496,7 @@ describe('makerChatStore text delta batching', () => {model: MODEL,effort: EFFORT,permissionMode: PERMISSION_MODE,- } as Awaited<ReturnType<typeof sessionService.get>>);+ } as unknown as Awaited<ReturnType<typeof sessionService.get>>);input.enqueue.mockImplementationOnce(async (sessionId: string) => projection(sessionId));emitDbMessageCreated({clientId: 'persisted-error-tail',@@ -2560,7 +2608,7 @@ describe('makerChatStore text delta batching', () => {model: MODEL,effort: EFFORT,permissionMode: PERMISSION_MODE,- } as Awaited<ReturnType<typeof sessionService.get>>);+ } as unknown as Awaited<ReturnType<typeof sessionService.get>>);input.enqueue.mockImplementationOnce(async (sessionId: string) => projection(sessionId));await makerChatStore.sendUiTrigger(SESSION_ID, '[UI_ACTION_TRIGGER] retry');diff --git a/apps/desktop/src/renderer/__tests__/markdownTargetRendererContract.test.ts b/apps/desktop/src/renderer/__tests__/markdownTargetRendererContract.test.tsindex ed5e23c238..2eca95c72b 100644--- a/apps/desktop/src/renderer/__tests__/markdownTargetRendererContract.test.ts+++ b/apps/desktop/src/renderer/__tests__/markdownTargetRendererContract.test.ts@@ -5,17 +5,17 @@ import { resolve } from 'node:path';const markdownRenderer = readFileSync(resolve(__dirname, '..', 'components', 'chat', 'MarkdownRenderer.tsx'),'utf8',-);+).replace(/\r\n?/g, '\n');const localPathResolver = readFileSync(resolve(__dirname, '..', 'lib', 'localPathResolver.ts'),'utf8',-);+).replace(/\r\n?/g, '\n');const textLightbox = readFileSync(resolve(__dirname, '..', 'components', 'chat', 'TextLightbox.tsx'),'utf8',-);+).replace(/\r\n?/g, '\n');describe('Markdown target rendering contract', () => {it('funnels markdown links and inline code through the shared target classifier', () => {diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.jsonindex 52b72900b1..3f186b085a 100644--- a/apps/desktop/src/renderer/i18n/locales/en/common.json+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json@@ -308,9 +308,9 @@"confirmTitle": "Push Codex credentials to remote?","confirmPush": "Push","confirmOverwrite": "Overwrite",- "descFirstPush": "This will install your local Codex credentials at ~/.codex/auth.json on {{hostId}}.",- "descOverwrite": "This will overwrite the existing Codex login on {{hostId}}.",- "descOverwriteWithAge": "This will overwrite the existing Codex login on {{hostId}} (last updated {{when}}).",+ "descFirstPush": "This will install your local Codex credentials in Cindy Codex home on {{hostId}} (~/.xdt-server/v1/codex-home/auth.json).",+ "descOverwrite": "This will overwrite the existing Codex login in Cindy Codex home on {{hostId}}.",+ "descOverwriteWithAge": "This will overwrite the existing Codex login in Cindy Codex home on {{hostId}} (last updated {{when}}).","warnOverwrite": "The current remote login will be lost. If someone is using Codex on that machine right now, they will be logged out.","warnShared": "Anyone who can SSH into {{hostId}} will be able to read this file and use your OpenAI account.","daysAgo": "{{n}} day(s) ago",@@ -4391,7 +4391,7 @@"credentialSwitchBusy": "Another Codex task is still running, so the provider for this session can't be applied yet (the shared Codex process needs a restart). Retry after those tasks finish.","codexThreadStale": "Codex auth mode changed — this session can't continue. Start a new session to apply it.","budgetModelHint": "If this keeps failing, try switching to the standard GPT model.",- "codexAuthMissing": "Remote codex hasn't been signed in yet (401 Unauthorized). Click \"Sync auth\" to push your local ~/.codex/auth.json to the remote, then retry.",+ "codexAuthMissing": "Remote Codex hasn't been signed in yet (401 Unauthorized). Click \"Sync auth\" to push your local Codex credentials to the remote Cindy Codex home, then retry.","codexAuthMissingLocal": "Codex credentials missing or expired (401 Unauthorized). Re-login in {{appName}} Settings → Codex (the app-server will auto-restart on login), or run `codex login` in your terminal and toggle the auth mode in Settings once to restart the app-server. Then start a new session.","codexSessionExpired": "The OpenAI connection needs an update. Reconnect ChatGPT to continue; {{appName}} won’t sign your system Codex CLI out or ask you to reconnect other model sources.","codexSessionExpiredDialog": {@@ -4403,7 +4403,7 @@"codexAuthSynced": "Auth synced. Click \"Retry\" to resend.","syncAuth": "Sync auth","syncAuthSyncing": "Syncing…",- "syncAuthTitle": "Push local ~/.codex/auth.json to remote codex-home",+ "syncAuthTitle": "Push local Codex credentials to remote Cindy Codex home","syncAuthSuccess": "Synced — click \"Retry\" to resend","syncAuthFailed": "Sync failed: {{msg}}","syncAuthDaemonRestartFailed": "Credentials pushed, but the old daemon did not restart — reconnect to the remote before retrying",diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.jsonindex a27172f5d4..a187d583d7 100644--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json@@ -308,9 +308,9 @@"confirmTitle": "Codex 認証情報をリモートに送りますか?","confirmPush": "送信","confirmOverwrite": "上書き",- "descFirstPush": "ローカルの Codex 認証情報を {{hostId}} の ~/.codex/auth.json にインストールします。",- "descOverwrite": "{{hostId}} 上の既存の Codex ログインを上書きします。",- "descOverwriteWithAge": "{{hostId}} 上の既存の Codex ログインを上書きします(最終更新: {{when}})。",+ "descFirstPush": "ローカルの Codex 認証情報を {{hostId}} の Cindy Codex home(~/.xdt-server/v1/codex-home/auth.json)にインストールします。",+ "descOverwrite": "{{hostId}} の Cindy Codex home にある既存の Codex ログインを上書きします。",+ "descOverwriteWithAge": "{{hostId}} の Cindy Codex home にある既存の Codex ログインを上書きします(最終更新: {{when}})。","warnOverwrite": "リモートの既存ログインは失われます。誰かが今 Codex を使っていれば、ログアウトされます。","warnShared": "{{hostId}} に SSH できる人はこのファイルを読めて、あなたの OpenAI アカウントを使えてしまいます。","daysAgo": "{{n}} 日前",@@ -4390,7 +4390,7 @@"credentialSwitchBusy": "他の Codex タスクが実行中のため、この会話で選択したプロバイダーへまだ切り替えられません(共有 Codex プロセスの再起動が必要です)。他のタスクの終了後に「再試行」を押してください。","codexThreadStale": "Codex の認証モードが切り替わりました。この会話は続行できません。新しい会話を開始してください。","budgetModelHint": "繰り返し失敗する場合は、通常版 GPT モデルに切り替えてお試しください。",- "codexAuthMissing": "リモートの codex がまだサインインしていません(401 Unauthorized)。「認証情報を同期」をクリックしてローカルの ~/.codex/auth.json をリモートにプッシュし、再試行してください。",+ "codexAuthMissing": "リモートの Codex がまだサインインしていません(401 Unauthorized)。「認証情報を同期」をクリックしてローカルの Codex 認証情報をリモートの Cindy Codex home にプッシュし、再試行してください。","codexAuthMissingLocal": "Codex 認証情報がないか期限切れです(401 Unauthorized)。{{appName}} Settings → Codex から再ログインする(ログイン時に app-server が自動再起動)か、ターミナルで `codex login` 実行後 Settings で認証モードを一度切り替えて app-server を再起動してから、新しい会話を開始してください。","codexSessionExpired": "OpenAI 接続の更新が必要です。ChatGPT に再接続すると続行できます。{{appName}} がシステムの Codex CLI からサインアウトしたり、他のモデルソースへの再接続を求めたりすることはありません。","codexSessionExpiredDialog": {@@ -4402,7 +4402,7 @@"codexAuthSynced": "認証情報が同期されました。「再試行」をクリックして再送信してください。","syncAuth": "認証情報を同期","syncAuthSyncing": "同期中…",- "syncAuthTitle": "ローカルの ~/.codex/auth.json をリモートの codex-home に同期",+ "syncAuthTitle": "ローカルの Codex 認証情報をリモートの Cindy Codex home に同期","syncAuthSuccess": "同期しました — 「再試行」をクリックして再送信してください","syncAuthFailed": "同期に失敗しました:{{msg}}","syncAuthDaemonRestartFailed": "認証情報はリモートに送信されましたが、古い daemon が再起動されませんでした — リモートに再接続してから再試行してください",diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.jsonindex 3dd4fa4bb6..80ee509a49 100644--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json@@ -308,9 +308,9 @@"confirmTitle": "Codex 자격 증명을 원격에 푸시하시겠습니까?","confirmPush": "푸시","confirmOverwrite": "덮어쓰기",- "descFirstPush": "로컬의 Codex 자격 증명을 {{hostId}} 의 ~/.codex/auth.json 에 설치합니다.",- "descOverwrite": "{{hostId}} 의 기존 Codex 로그인을 덮어씁니다.",- "descOverwriteWithAge": "{{hostId}} 의 기존 Codex 로그인을 덮어씁니다(마지막 업데이트: {{when}}).",+ "descFirstPush": "로컬 Codex 자격 증명을 {{hostId}}의 Cindy Codex home(~/.xdt-server/v1/codex-home/auth.json)에 설치합니다.",+ "descOverwrite": "{{hostId}}의 Cindy Codex home에 있는 기존 Codex 로그인을 덮어씁니다.",+ "descOverwriteWithAge": "{{hostId}}의 Cindy Codex home에 있는 기존 Codex 로그인을 덮어씁니다(마지막 업데이트: {{when}}).","warnOverwrite": "원격의 기존 로그인은 사라집니다. 누군가 지금 Codex 를 사용 중이면 로그아웃됩니다.","warnShared": "{{hostId}} 에 SSH 로 들어올 수 있는 사람은 이 파일을 읽고 당신의 OpenAI 계정을 사용할 수 있습니다.","daysAgo": "{{n}} 일 전",@@ -4390,7 +4390,7 @@"credentialSwitchBusy": "다른 Codex 작업이 실행 중이어서 이 대화에서 선택한 제공자로 아직 전환할 수 없습니다(공유 Codex 프로세스 재시작 필요). 다른 작업이 끝난 후 ‘재시도’를 눌러 주세요.","codexThreadStale": "Codex 인증 모드가 변경되었습니다. 이 대화는 계속할 수 없습니다. 새 대화를 시작하세요.","budgetModelHint": "계속 실패하면 일반 GPT 모델로 전환해 보세요.",- "codexAuthMissing": "원격 codex가 아직 로그인되지 않았습니다(401 Unauthorized). 「인증 동기화」를 클릭하여 로컬 ~/.codex/auth.json을 원격으로 푸시한 후 다시 시도하세요.",+ "codexAuthMissing": "원격 Codex가 아직 로그인되지 않았습니다(401 Unauthorized). 「인증 동기화」를 클릭하여 로컬 Codex 자격 증명을 원격 Cindy Codex home으로 푸시한 후 다시 시도하세요.","codexAuthMissingLocal": "Codex 자격 증명이 없거나 만료되었습니다(401 Unauthorized). {{appName}} Settings → Codex에서 다시 로그인하거나(로그인 시 app-server가 자동 재시작) 터미널에서 `codex login` 실행 후 Settings에서 인증 모드를 한 번 전환하여 app-server를 재시작한 다음 새 대화를 시작하세요.","codexSessionExpired": "OpenAI 연결을 업데이트해야 합니다. ChatGPT를 다시 연결하면 계속할 수 있습니다. {{appName}}에서 시스템 Codex CLI를 로그아웃하거나 다른 모델 소스의 재연결을 요구하지 않습니다.","codexSessionExpiredDialog": {@@ -4402,7 +4402,7 @@"codexAuthSynced": "인증이 동기화되었습니다. 「다시 시도」를 클릭하여 다시 보내세요.","syncAuth": "인증 동기화","syncAuthSyncing": "동기화 중…",- "syncAuthTitle": "로컬 ~/.codex/auth.json을 원격 codex-home에 푸시",+ "syncAuthTitle": "로컬 Codex 자격 증명을 원격 Cindy Codex home으로 푸시","syncAuthSuccess": "동기화되었습니다 — 「다시 시도」를 클릭하여 다시 보내세요","syncAuthFailed": "동기화 실패: {{msg}}","syncAuthDaemonRestartFailed": "자격 증명이 원격에 푸시되었지만 이전 daemon이 재시작되지 않았습니다 — 원격에 다시 연결한 후 재시도하세요",diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.jsonindex b868fbe83a..fe28c6b9cc 100644--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json@@ -308,9 +308,9 @@"confirmTitle": "推送 Codex 凭证到远端?","confirmPush": "推送","confirmOverwrite": "覆盖",- "descFirstPush": "这会把本机的 Codex 凭证装到 {{hostId}} 的 ~/.codex/auth.json。",- "descOverwrite": "这会覆盖 {{hostId}} 上已有的 Codex 登录态。",- "descOverwriteWithAge": "这会覆盖 {{hostId}} 上已有的 Codex 登录态(上次更新于 {{when}})。",+ "descFirstPush": "这会把本机的 Codex 凭证装到 {{hostId}} 的 Cindy Codex home(~/.xdt-server/v1/codex-home/auth.json)。",+ "descOverwrite": "这会覆盖 {{hostId}} 的 Cindy Codex home 中已有的 Codex 登录态。",+ "descOverwriteWithAge": "这会覆盖 {{hostId}} 的 Cindy Codex home 中已有的 Codex 登录态(上次更新于 {{when}})。","warnOverwrite": "远端原有的登录会被替换。如果当下有人正在那台机器上用 Codex,他们会被踢下线。","warnShared": "任何能 SSH 进 {{hostId}} 的人都可以读这个文件,用你的 OpenAI 账号。","daysAgo": "{{n}} 天前",@@ -4390,7 +4390,7 @@"credentialSwitchBusy": "其他 Codex 任务正在运行,暂时无法按本对话选择的模型来源切换(需要重启共享的 Codex 后台进程)。等其他任务结束后点「重试」即可。","codexThreadStale": "Codex 鉴权模式已切换,当前对话无法继续 —— 请新建对话后生效。","budgetModelHint": "如果反复失败,可以切换到普通版 GPT 再试试。",- "codexAuthMissing": "远端 codex 还没同步登录态(401 Unauthorized)。点击右侧「同步登录态」把本地 ~/.codex/auth.json 推到远端,然后重试发送。",+ "codexAuthMissing": "远端 Codex 还没同步登录态(401 Unauthorized)。点击右侧「同步登录态」把本机 Codex 凭证推到远端 Cindy Codex home,然后重试发送。","codexAuthMissingLocal": "Codex 凭证缺失或失效(401 Unauthorized)。请在 {{appName}} Settings → Codex 重新登录(登录后会自动重启 Codex app-server),或在终端跑 `codex login` + 在 Settings 切换一次鉴权模式来重启 app-server,然后新建对话再发。","codexSessionExpired": "OpenAI 连接需要更新。重新连接 ChatGPT 后即可继续;{{appName}} 不会退出系统 Codex CLI,也不会要求你重新连接其他模型来源。","codexSessionExpiredDialog": {@@ -4402,7 +4402,7 @@"codexAuthSynced": "登录态已同步,请点击「重试」重新发送。","syncAuth": "同步登录态","syncAuthSyncing": "同步中…",- "syncAuthTitle": "把本地 ~/.codex/auth.json 同步到远端 codex-home",+ "syncAuthTitle": "把本机 Codex 凭证同步到远端 Cindy Codex home","syncAuthSuccess": "已同步,请点击「重试」重新发送","syncAuthFailed": "同步失败:{{msg}}","syncAuthDaemonRestartFailed": "凭证已推送到远端,但旧 daemon 没重启 — 请重连远端后再点重试",diff --git a/apps/desktop/src/renderer/lib/makerChatStore.ts b/apps/desktop/src/renderer/lib/makerChatStore.tsindex 202c90bd73..00b4eda875 100644--- a/apps/desktop/src/renderer/lib/makerChatStore.ts+++ b/apps/desktop/src/renderer/lib/makerChatStore.ts@@ -116,7 +116,7 @@ const log = createLogger('CcAgentChatStore');// + setState),用于会话切换卡顿归因;<30ms 不打,避免噪音。const perfLog = createLogger('perf/session-switch');export const EMPTY_TASK_UPDATES: ReadonlyMap<string, AgentTaskUpdate> = new Map();-/** Max consecutive auto auth-retries per remote session before surfacing the error. */+/** Max consecutive legacy CC/XD auto auth-retries per remote session before surfacing the error. */const MAX_REMOTE_AUTH_RETRIES = 2;/** Bound best-effort main-side /clear guard arming so local cleanup cannot hang forever. */const CLEAR_SESSION_GUARD_TIMEOUT_MS = 500;@@ -359,7 +359,7 @@ export interface ChatMessage {/** F-MSG-DOC: document/file attachments (path) for rendering as @path in message stream */files?: Array<{ name: string; path: string }>;/**- * Remote auth-retry / cc-mgr upgrade retry payload: the original send's+ * Legacy CC/XD remote auth-retry / cc-mgr upgrade retry payload: the original send's* attachments + mentions, kept on the user message so an auto-retry (or the* UpgradeBanner resend) can replay the exact same turn. Set at send time,* not persisted to the server.@@ -3463,7 +3463,7 @@ function initGlobalListeners(): void {// parent_tool_use_id / sdkSessionId / model / ... 提取并塞在 event 顶层, 这里把它转到// CCAgentStreamEvent.agentMeta 让 handleStreamEvent 落库 messages.agent_meta 行,// fork / rewind 反向找 prior assistant 锚点要靠这个字段。- // Remote auth-retry: 在 reducer 写 error 之前拦截,避免 error banner 闪烁。+ // Legacy CC/XD remote auth-retry: 在 reducer 写 error 之前拦截,避免 error banner 闪烁。if (event.type === 'error') {const errData =(event.data as { sdkError?: string; message?: string; errorStatus?: number }) ?? {};@@ -3476,6 +3476,7 @@ function initGlobalListeners(): void {if (isAuthError &&preSnap.remoteHostId &&+ preSnap.agentKind === 'claude-code' &&!preSnap._authRetryInFlight &&authRetryCount < MAX_REMOTE_AUTH_RETRIES) {@@ -3576,13 +3577,22 @@ function initGlobalListeners(): void {}}// guard fall-through(cap 超限 / 已重试同消息):重试不会发生。- // main 侧对所有 remote auth error 均跳过持久化;在此补落。+ // 仅 legacy CC/XD 在此补落:main 侧只对 CC remote auth error 跳过持久化+ // (isRemoteAuthRetryErrorEvent 对 codex 直接返回 false),由这里的 deferred+ // IPC 兜底。Codex remote auth error 在 main 侧走正常 onTurnErrorEvent 热路径+ // 落库;这里再落会双写——Codex 事件无 agentMeta,main 又在广播后 reset turn+ // 身份,两次落库的 dedup key 对不上,重开会话会出现重复错误卡。// 限制仅当 preSnap.remoteHostId 已加载时才触发:// - 对于已加载的远程会话,能确认无 retry 在途,可安全落库。// - 对于从未打开的后台会话(remoteHostId 为 null),无法判断另一个窗口// 是否正在 retry;贸然落库若 retry 成功会留下虚假错误卡,不落库则// 等价于旧行为(重启后错误丢失)—— 保守起见不做 deferred。- if (isAuthError && preSnap.remoteHostId && !preSnap._authRetryInFlight) {+ if (+ isAuthError &&+ preSnap.remoteHostId &&+ preSnap.agentKind === 'claude-code' &&+ !preSnap._authRetryInFlight+ ) {void makerApiFor(sessionId).input.persistTurnErrorDeferred(sessionId,event.data as Record<string, unknown> | null,diff --git a/i18n/GLOSSARY.md b/i18n/GLOSSARY.mdindex ef4f932cbe..b399b46d1a 100644--- a/i18n/GLOSSARY.md+++ b/i18n/GLOSSARY.md@@ -124,6 +124,10 @@**注意别指望 `--update-baseline` 帮你收尾。** `proposed` 存在的理由正是「已知有存量不一致」,改成 `decided` 的那一刻这些告警会变成阻断违规;而 `--update-baseline` 只删不加,遇到 baseline 里没有的指纹会直接拒绝。所以裁决时只有两条路:要么把命中逐条读语境改掉,要么先人工把已 review 过的指纹写进 `i18n/glossary-baseline.json` 冻结存量,之后再用 `--update-baseline` 做修剪。+### Cindy Codex home++远端主机上由 Cindy 管理的 Codex 凭证目录(~/.xdt-server/v1/codex-home/),与用户本机 ~/.codex 相区分。四语统一保留英文原词(home 小写),避免各语言自造「Codex 主目录」等不同说法;syncAuth 与 codexAuthMissing 等远端登录态文案使用。+### Content Update指不更换 TestFlight 或商店安装包、可通过 OTA 下发的 JS 与资源更新。当前先采用四语直译并登记为待讨论术语,避免与整包更新或测试版本更新混称。diff --git a/i18n/glossary.json b/i18n/glossary.jsonindex 706d772b28..28a2eaa8c8 100644--- a/i18n/glossary.json+++ b/i18n/glossary.json@@ -34,6 +34,17 @@},"note": "OAuth 2.0 Device Authorization Grant 中由用户在另一设备验证页输入的一次性代码。当前先采用各语言直译,作为待产品裁决术语登记,避免后续界面出现“设备代码/配对码/认证码”等多套说法。"},+ {+ "id": "cindy-codex-home",+ "status": "proposed",+ "en": "Cindy Codex home",+ "translations": {+ "zh-CN": "Cindy Codex home",+ "ja": "Cindy Codex home",+ "ko": "Cindy Codex home"+ },+ "note": "远端主机上由 Cindy 管理的 Codex 凭证目录(~/.xdt-server/v1/codex-home/),与用户本机 ~/.codex 相区分。四语统一保留英文原词(home 小写),避免各语言自造「Codex 主目录」等不同说法;syncAuth 与 codexAuthMissing 等远端登录态文案使用。"+ },{"id": "agent","status": "decided",