Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(teammates): fix Lite welcome requests and localize errors (#4918)
Chris Zhang0bf2f5d2d17b
diff --git a/apps/desktop/src/main/maker-host/__tests__/codexTextOnlyPolicy.native.test.ts b/apps/desktop/src/main/maker-host/__tests__/codexTextOnlyPolicy.native.test.tsindex 8b7c4ec833..a2ff349487 100644--- a/apps/desktop/src/main/maker-host/__tests__/codexTextOnlyPolicy.native.test.ts+++ b/apps/desktop/src/main/maker-host/__tests__/codexTextOnlyPolicy.native.test.ts@@ -49,9 +49,9 @@ it.skipIf(!binary).each([false, true])('native full-access welcome refuses rogueawait new Promise<void>(resolve => server.listen(0, '127.0.0.1', resolve));const upstream = `http://127.0.0.1:${(server.address() as { port: number }).port}`;proxy = await createAnthropicCompatProxy({ upstream, transformRequest: [],- requestGuard: ctx => codexTextOnlyRequestGuard(isCodexTextOnly(selectedHeaderValue(ctx.headers, STABLE_THREAD_ID_HEADERS) ?? ''), ctx),+ requestGuard: ctx => codexTextOnlyRequestGuard(isCodexTextOnly(selectedHeaderValue(ctx.headers, STABLE_THREAD_ID_HEADERS) ?? ''), ctx, base => base === upstream),resolveWebSocketUpstream: () => upstream,- webSocketTransforms: ctx => codexTextOnlyWebSocketTransforms(() => isCodexTextOnly(selectedHeaderValue(ctx.headers, STABLE_THREAD_ID_HEADERS) ?? '')),+ webSocketTransforms: ctx => codexTextOnlyWebSocketTransforms(() => isCodexTextOnly(selectedHeaderValue(ctx.headers, STABLE_THREAD_ID_HEADERS) ?? ''), true),});host = new AppServerHost({ logger, clientInfo: { name: 'cindy-native-text-only', version: '1' },createTransport: () => createStdioTransport({ binaryPath: binary!, cwd: root,diff --git a/apps/desktop/src/main/maker-host/__tests__/codexTextOnlyPolicy.test.ts b/apps/desktop/src/main/maker-host/__tests__/codexTextOnlyPolicy.test.tsindex bdca460668..076e09f6ff 100644--- a/apps/desktop/src/main/maker-host/__tests__/codexTextOnlyPolicy.test.ts+++ b/apps/desktop/src/main/maker-host/__tests__/codexTextOnlyPolicy.test.ts@@ -1,3 +1,4 @@+import { sanitizeXaiTools } from '@cindy/model-compat';import WebSocket, { WebSocketServer } from 'ws';import { createServer, type Server } from 'node:http';import { once } from 'node:events';@@ -21,26 +22,61 @@ const tool = { type: 'function_call', name: 'exec_command', call_id: 'bad', arguconst frame = (event: unknown) => `data: ${JSON.stringify(event)}\n\n`;describe('Codex text-only request policy', () => {- it('freezes the welcome policy before routing and restores ordinary tools without changing history', async () => {+ it.each([false, true, undefined])('keeps Lite welcome requests serial and restores ordinary tools (parallel=%s)', async parallel => {let disabled = true;const dispose = registerCodexTextOnlyPolicy('t', () => disabled); closers.push(dispose);const received: unknown[] = [];const upstream = await listen(createServer(async (req, res) => {let body = ''; for await (const chunk of req) body += chunk;- received.push(JSON.parse(body));+ const request = JSON.parse(body);+ received.push(request);+ if (request.tools.length === 0 && request.parallel_tool_calls !== false) {+ res.writeHead(400); res.end('Responses Lite requires parallel_tool_calls=false'); return;+ }res.setHeader('content-type', 'text/event-stream'); res.end(frame(completed([text])));}));- const handle = await proxy({ upstream,+ const handle = await proxy({ upstream: 'https://unused-gateway.invalid/v1',+ routingTransform: () => ({ upstreamOverride: upstream }),// Existing Gateway/xAI adapters can add hosted search after ingress.transformRequest: [body => Array.isArray((body as { tools?: unknown[] }).tools) && (body as { tools: unknown[] }).tools.length === 0? { ...body as Record<string, unknown>, tools: [{ type: 'web_search' }], tool_choice: 'auto' } : null],- requestGuard: ctx => codexTextOnlyRequestGuard(isCodexTextOnly('t'), ctx),+ requestGuard: ctx => codexTextOnlyRequestGuard(isCodexTextOnly('t'), ctx, base => base === upstream),});- const body = { model: 'test', tools: [{ type: 'web_search' }, { type: 'function', name: 'exec_command' }], tool_choice: 'auto', input: [{ role: 'user', content: 'Hi' }] };+ const body = { ...(parallel === undefined ? {} : { parallel_tool_calls: parallel }), model: 'test', tools: [{ type: 'web_search' }, { type: 'function', name: 'exec_command' }], tool_choice: 'auto', input: [{ role: 'user', content: 'Hi' }] };await expect((await fetch(`${handle.url}/responses`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) })).text()).resolves.toContain('Hello');disabled = false;await (await fetch(`${handle.url}/responses`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) })).text();- expect(received).toEqual([{ ...body, tools: [], tool_choice: 'none' }, body]);+ expect(received).toEqual([{ ...body, tools: [], tool_choice: 'none', parallel_tool_calls: false }, body]);+ });++ it.each([false, true, undefined])('preserves non-Lite empty-tool compatibility after xAI transforms (parallel=%s)', async parallel => {+ for (const hostedSearch of [false, true]) {+ const received: Record<string, unknown>[] = [];+ const upstream = await listen(createServer(async (req, res) => {+ let bytes = ''; for await (const chunk of req) bytes += chunk;+ const body = JSON.parse(bytes); received.push(body);+ if (body.tool_choice !== undefined || body.parallel_tool_calls !== undefined) {+ res.writeHead(400); res.end('Empty tools cannot have control fields'); return;+ }+ res.setHeader('content-type', 'text/event-stream'); res.end(frame(completed([text])));+ }));+ const handle = await proxy({ upstream: 'https://chatgpt.com/backend-api/codex',+ routingTransform: () => ({ upstreamOverride: upstream }),+ transformRequest: [body => {+ const sanitized = sanitizeXaiTools(body as Record<string, unknown>, {+ preserveNoneToolChoice: hostedSearch, preserveSerialToolCalls: hostedSearch,+ }) ?? body as Record<string, unknown>;+ return hostedSearch ? { ...sanitized, tools: [{ type: 'x_search' }] } : sanitized;+ }],+ requestGuard: ctx => codexTextOnlyRequestGuard(true, ctx, base => base === 'https://chatgpt.com/backend-api/codex'),+ });+ const body = { model: 'grok', tools: [{ type: 'web_search' }], tool_choice: 'auto',+ ...(parallel === undefined ? {} : { parallel_tool_calls: parallel }) };+ const response = await fetch(`${handle.url}/responses`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) });+ expect(response.status).toBe(200);+ expect(await response.text()).toContain('Hello');+ expect(received).toEqual([{ model: 'grok', tools: [] }]);+ }});it.each([false, true])('blocks a tool returned against tool_choice even through a local adapter (%s)', async local => {@@ -92,7 +128,7 @@ describe('Codex text-only request policy', () => {});-it('enforces welcome and normal requests on the same WebSocket, including fragmented messages and ping frames', async () => {+it.each([false, true, undefined])('enforces Lite welcome and normal requests on the same fragmented WebSocket (parallel=%s)', async parallel => {let disabled = true;const received: Array<Record<string, unknown>> = [];const http = createServer();@@ -101,23 +137,26 @@ it('enforces welcome and normal requests on the same WebSocket, including fragmeclosers.push(() => { for (const client of sockets.clients) client.terminate(); sockets.close(); });sockets.on('connection', socket => socket.on('message', data => {const body = JSON.parse(data.toString()); received.push(body);+ if (body.tools.length === 0 && body.parallel_tool_calls !== false) {+ socket.send(JSON.stringify({ type: 'error', error: { message: 'Responses Lite requires parallel_tool_calls=false' } })); return;+ }socket.send(JSON.stringify(completed([body.tools.length === 0 ? text : tool])));}));const handle = await proxy({ upstream, resolveWebSocketUpstream: () => upstream,- webSocketTransforms: () => codexTextOnlyWebSocketTransforms(() => disabled),+ webSocketTransforms: () => codexTextOnlyWebSocketTransforms(() => disabled, true),});const client = new WebSocket(`${handle.url.replace('http:', 'ws:')}/responses`, { perMessageDeflate: true });closers.push(() => client.terminate());await once(client, 'open');expect(client.extensions).toBe('');- const body = JSON.stringify({ type: 'response.create', model: 'test', tools: [{ type: 'web_search' }] });+ const body = JSON.stringify({ ...(parallel === undefined ? {} : { parallel_tool_calls: parallel }), type: 'response.create', model: 'test', tools: [{ type: 'web_search' }] });let response = once(client, 'message');client.send(body.slice(0, 30), { fin: false }); client.ping('alive'); client.send(body.slice(30), { fin: true });expect(JSON.parse(String((await response)[0]))).toEqual(completed([text]));disabled = false;response = once(client, 'message'); client.send(body);expect(JSON.parse(String((await response)[0]))).toEqual(completed([tool]));- expect(received[0]).toMatchObject({ tools: [], tool_choice: 'none' });+ expect(received[0]).toMatchObject({ tools: [], tool_choice: 'none', parallel_tool_calls: false });expect(received[1]).toEqual(JSON.parse(body));});@@ -131,7 +170,7 @@ it('closes a WebSocket without forwarding a forbidden response, even after the lsocket.send(JSON.stringify({ type: 'response.output_item.added', item: tool }));}));const handle = await proxy({ upstream, resolveWebSocketUpstream: () => upstream,- webSocketTransforms: () => codexTextOnlyWebSocketTransforms(() => disabled),+ webSocketTransforms: () => codexTextOnlyWebSocketTransforms(() => disabled, true),});const client = new WebSocket(`${handle.url.replace('http:', 'ws:')}/responses`);closers.push(() => client.terminate()); await once(client, 'open');diff --git a/apps/desktop/src/main/maker-host/codex-proxy-host.ts b/apps/desktop/src/main/maker-host/codex-proxy-host.tsindex c6d79bfe20..7b4c4e1d02 100644--- a/apps/desktop/src/main/maker-host/codex-proxy-host.ts+++ b/apps/desktop/src/main/maker-host/codex-proxy-host.ts@@ -3207,8 +3207,9 @@ function createCodexProxyHandle(return path.kind !== 'not-custom-provider-route'&& !(path.kind === 'route' && path.pathKind === 'responses');},- requestGuard: ctx => codexTextOnlyRequestGuard(isCodexTextOnly(selectedThreadIdFromHeaders(ctx.headers)), ctx),- webSocketTransforms: ctx => codexTextOnlyWebSocketTransforms(() => isCodexTextOnly(selectedThreadIdFromHeaders(ctx.headers))),+ requestGuard: ctx => codexTextOnlyRequestGuard(isCodexTextOnly(selectedThreadIdFromHeaders(ctx.headers)), ctx, isChatGptUpstreamBase),+ // Accepted WebSockets route exclusively to CODEX_OAUTH_UPSTREAM (see resolver below).+ webSocketTransforms: ctx => codexTextOnlyWebSocketTransforms(() => isCodexTextOnly(selectedThreadIdFromHeaders(ctx.headers)), true),transformResponse: (ctx) => {const response = {contentType: ctx.responseHeaders['content-type'] ?? '',diff --git a/apps/desktop/src/main/maker-host/codex-text-only-policy.ts b/apps/desktop/src/main/maker-host/codex-text-only-policy.tsindex 4f681d0e09..e37baf3290 100644--- a/apps/desktop/src/main/maker-host/codex-text-only-policy.ts+++ b/apps/desktop/src/main/maker-host/codex-text-only-policy.ts@@ -22,11 +22,19 @@ function object(value: unknown): value is Record<string, unknown> {function reject(): never { throw new Error('Codex text-only turn rejected a tool-capable payload'); }/** Definitions are removed before any provider adapter or hosted tool can consume them. */-export function restrictCodexRequest(bytes: Buffer): Buffer {+export function restrictCodexRequest(bytes: Buffer, options: { serial?: boolean; afterProvider?: boolean } = {}): Buffer {const body: unknown = JSON.parse(bytes.toString('utf8'));if (!object(body)) return reject();- delete body.parallel_tool_calls;- return Buffer.from(JSON.stringify({ ...body, tools: [], tool_choice: 'none' }));+ const next: Record<string, unknown> = { ...body, tools: [] };+ // Ingress disables tool selection before adapters inspect it. Non-Lite+ // egress has no tools, so remove controls that empty-tool providers reject,+ // including controls retained for hosted tools that we strip here.+ if (options.afterProvider && !options.serial) delete next.tool_choice;+ else next.tool_choice = 'none';+ delete next.parallel_tool_calls;+ // Only the resolved ChatGPT Responses route needs the Lite serial flag.+ if (options.serial) next.parallel_tool_calls = false;+ return Buffer.from(JSON.stringify(next));}function validateItem(item: unknown): void {@@ -105,17 +113,21 @@ export function createCodexTextOnlyResponseGuard(contentType: string, encoding =export function codexTextOnlyRequestGuard(disabled: boolean,ctx: { method: string; url: string; headers: Readonly<Record<string, string>> },+ requiresSerial: (upstreamBase: string | undefined) => boolean = () => false,): ReturnType<NonNullable<ProxyOptions['requestGuard']>> {if (!disabled || ctx.method === 'GET' || ctx.method === 'HEAD') return null;if (!/\/responses\/?(?:\?.*)?$/.test(ctx.url)|| (ctx.headers['content-encoding'] && ctx.headers['content-encoding'] !== 'identity')) return reject();return {- transformBody: restrictCodexRequest,+ transformBody: (body, route) => restrictCodexRequest(body, {+ afterProvider: Boolean(route),+ serial: Boolean(route) && requiresSerial(route?.upstreamBase),+ }),response: headers => createCodexTextOnlyResponseGuard(String(headers['content-type'] ?? ''), String(headers['content-encoding'] ?? '')),};}-export function codexTextOnlyWebSocketTransforms(disabled: () => boolean) {+export function codexTextOnlyWebSocketTransforms(disabled: () => boolean, requiresSerial = false) {// Frozen at each request, never relaxed by a subsequent UI send or teardown.let restricted = false;let completed = true;@@ -125,7 +137,7 @@ export function codexTextOnlyWebSocketTransforms(disabled: () => boolean) {if (restricted && !completed) reject();restricted = next;completed = false;- return restricted ? restrictCodexRequest(message) : message;+ return restricted ? restrictCodexRequest(message, { serial: requiresSerial }) : message;}),inbound: createWebSocketMessageTransform(false, message => {if (restricted) {diff --git a/apps/desktop/src/renderer/__tests__/errorBannerGatewayProxyToken.test.tsx b/apps/desktop/src/renderer/__tests__/errorBannerGatewayProxyToken.test.tsxindex 48c827d097..8f8a84102c 100644--- a/apps/desktop/src/renderer/__tests__/errorBannerGatewayProxyToken.test.tsx+++ b/apps/desktop/src/renderer/__tests__/errorBannerGatewayProxyToken.test.tsx@@ -83,7 +83,7 @@ describe('ErrorBanner — LiteLLM 网关凭据失效', () => {expect(screen.getByText('chat.errorBanner.gatewayProxyTokenInvalidNoRetry')).toBeTruthy();});- it('keeps a custom LiteLLM provider error as provider-owned raw text', () => {+ it('keeps a custom LiteLLM provider error in details without Gateway attribution', () => {render(createElement(ErrorBanner, {error: LITELLM_401,@@ -95,6 +95,9 @@ describe('ErrorBanner — LiteLLM 网关凭据失效', () => {);expect(screen.queryByText('chat.errorBanner.gatewayProxyTokenInvalid')).toBeNull();+ expect(screen.getByText('chat.errorBanner.replyFailed')).toBeTruthy();+ expect(screen.queryByText(LITELLM_401)).toBeNull();+ fireEvent.click(screen.getByText('chat.errorBanner.networkShowRaw'));expect(screen.getByText(LITELLM_401)).toBeTruthy();});diff --git a/apps/desktop/src/renderer/__tests__/errorBannerGatewayQuota.test.tsx b/apps/desktop/src/renderer/__tests__/errorBannerGatewayQuota.test.tsxindex c3a60d2bda..15473894fa 100644--- a/apps/desktop/src/renderer/__tests__/errorBannerGatewayQuota.test.tsx+++ b/apps/desktop/src/renderer/__tests__/errorBannerGatewayQuota.test.tsx@@ -4,8 +4,8 @@* ErrorBanner — Cindy AI 网关余额耗尽的导流不变量:* 1. 来源确定是 xd 且计费面可见(父组件传了 onViewBalance)→ 文案换成「余额不足,* 请充值后继续」并给出右端内联「查看余额」。- * 2. 来源是其它供应商 → 一个字都不改,也不加按钮(没有可跳的地方)。- * 3. 来源是 xd 但计费面不可见(org / local,父组件不传回调)→ 同样不改、不加按钮。+ * 2. 来源是其它供应商 → 使用通用本地化摘要,不加余额按钮(没有可跳的地方)。+ * 3. 来源是 xd 但计费面不可见(org / local,父组件不传回调)→ 同样走通用摘要、不加余额按钮。* 4. 非余额类错误不被这条分支吃掉。*/@@ -89,7 +89,7 @@ describe('ErrorBanner — Cindy AI 余额不足导流', () => {expect(onRetry).toHaveBeenCalledWith('retry-token');});- it('其它供应商保持现状:不改文案、不加按钮', () => {+ it('其它供应商使用通用摘要,不加余额按钮', () => {render(createElement(ErrorBanner, {error: QUOTA_ERROR,@@ -101,6 +101,9 @@ describe('ErrorBanner — Cindy AI 余额不足导流', () => {}),);+ expect(screen.getByText('chat.errorBanner.replyFailed')).toBeTruthy();+ expect(screen.queryByText(QUOTA_ERROR)).toBeNull();+ fireEvent.click(screen.getByText('chat.errorBanner.networkShowRaw'));expect(screen.getByText(QUOTA_ERROR)).toBeTruthy();expect(screen.queryByText('chat.errorBanner.gatewayQuotaExhausted')).toBeNull();expect(screen.queryByTitle('chat.errorBanner.viewBalanceTitle')).toBeNull();@@ -118,6 +121,9 @@ describe('ErrorBanner — Cindy AI 余额不足导流', () => {}),);+ expect(screen.getByText('chat.errorBanner.replyFailed')).toBeTruthy();+ expect(screen.queryByText(QUOTA_ERROR)).toBeNull();+ fireEvent.click(screen.getByText('chat.errorBanner.networkShowRaw'));expect(screen.getByText(QUOTA_ERROR)).toBeTruthy();expect(screen.queryByTitle('chat.errorBanner.viewBalanceTitle')).toBeNull();});@@ -133,6 +139,9 @@ describe('ErrorBanner — Cindy AI 余额不足导流', () => {}),);+ expect(screen.getByText('chat.errorBanner.replyFailed')).toBeTruthy();+ expect(screen.queryByText(QUOTA_ERROR)).toBeNull();+ fireEvent.click(screen.getByText('chat.errorBanner.networkShowRaw'));expect(screen.getByText(QUOTA_ERROR)).toBeTruthy();expect(screen.queryByText('chat.errorBanner.gatewayQuotaExhausted')).toBeNull();expect(screen.queryByTitle('chat.errorBanner.viewBalanceTitle')).toBeNull();@@ -206,6 +215,9 @@ describe('ErrorBanner — Cindy AI 余额不足导流', () => {}),);+ expect(screen.getByText('chat.errorBanner.replyFailed')).toBeTruthy();+ expect(screen.queryByText(QUOTA_ERROR)).toBeNull();+ fireEvent.click(screen.getByText('chat.errorBanner.networkShowRaw'));expect(screen.getByText(QUOTA_ERROR)).toBeTruthy();expect(screen.queryByText('chat.errorBanner.gatewayQuotaExhausted')).toBeNull();expect(screen.queryByTitle('chat.errorBanner.viewBalanceTitle')).toBeNull();diff --git a/apps/desktop/src/renderer/__tests__/errorBannerStreamInterrupt.test.tsx b/apps/desktop/src/renderer/__tests__/errorBannerStreamInterrupt.test.tsxindex fd0d45b9b0..3898bdf4ad 100644--- a/apps/desktop/src/renderer/__tests__/errorBannerStreamInterrupt.test.tsx+++ b/apps/desktop/src/renderer/__tests__/errorBannerStreamInterrupt.test.tsx@@ -189,7 +189,7 @@ describe('ErrorBanner — LiteLLM 外壳拆封', () => {}),);- expect(screen.getByText('Upstream rejected the request!')).toBeTruthy();+ expect(screen.getByText('chat.errorBanner.replyFailed')).toBeTruthy();expect(screen.queryByText(XAI_REJECTED_RAW)).toBeNull();fireEvent.click(screen.getByText('chat.errorBanner.networkShowRaw'));expect(screen.getByText(XAI_REJECTED_RAW)).toBeTruthy();diff --git a/apps/desktop/src/renderer/__tests__/remoteErrorDecode.test.ts b/apps/desktop/src/renderer/__tests__/remoteErrorDecode.test.tsindex 054425fd0a..98ff160b5c 100644--- a/apps/desktop/src/renderer/__tests__/remoteErrorDecode.test.ts+++ b/apps/desktop/src/renderer/__tests__/remoteErrorDecode.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from 'vitest';-import { decodeRemoteErrorMessage } from '@/lib/makerChatStore';+import { decodeRemoteErrorMessage, remoteErrorMessageForBanner } from '@/lib/makerChatStore';describe('decodeRemoteErrorMessage', () => {it.each([@@ -36,6 +36,13 @@ describe('decodeRemoteErrorMessage', () => {it('decodes remote agent errors while preserving fallback text for missing keys', () => {expect(decodeRemoteErrorMessage('[REMOTE_UNKNOWN] fallback message')).toBe('fallback message');+ expect(remoteErrorMessageForBanner('[REMOTE_UNKNOWN] fallback message')).toBe('fallback message');+ });++ it('keeps known codes available to live and tail banners while other callers still get translated text', () => {+ const raw = '[REMOTE_LOCAL_ONLY_PROVIDER] use a different provider';+ expect(remoteErrorMessageForBanner(raw)).toBe(raw);+ expect(decodeRemoteErrorMessage(raw)).not.toBe(raw);});it('maps a missing auto-review confirmation to i18n text, not a user rejection', () => {diff --git a/apps/desktop/src/renderer/components/chat/ErrorBanner.tsx b/apps/desktop/src/renderer/components/chat/ErrorBanner.tsxindex 7dab83898b..4d9cb3f28c 100644--- a/apps/desktop/src/renderer/components/chat/ErrorBanner.tsx+++ b/apps/desktop/src/renderer/components/chat/ErrorBanner.tsx@@ -16,7 +16,7 @@ import { useProviders } from '@/hooks/useProviders';import { useEffect, useState } from 'react';import { isCodexResumeNotReadyProjectionError } from '@cindy/maker-shared/agent-input-projection';-import { isCindyGatewayProxyTokenInvalidError } from '@cindy/maker-shared/error-redaction';+import { isCindyGatewayProxyTokenInvalidError, isResponsesLiteParallelToolCallsError, parseAgentErrorCode, redactSensitiveText } from '@cindy/maker-shared/error-redaction';import {AlertCircle,Check,@@ -47,7 +47,6 @@ import { isNetworkishErrorMessage, parseReconnectAttemptMessage } from '@/utils/import { isOverloadErrorMessage, parseOverloadRetryProgress } from '@/utils/overloadError';import {isStreamInterruptedErrorMessage,- unwrapProviderErrorDisplay,} from '@/utils/streamInterruptError';import { isQuotaExhaustedErrorMessage } from '@/utils/quotaError';import { parseTerminalRateLimitRetryProgress } from '@/utils/rateLimitRetry';@@ -284,7 +283,6 @@ export function ErrorBanner({// (老 daemon / Anthropic 侧 / 历史持久化错误行 —— 后者只有文案可用)。const isOverloadError = isOverloadErrorMessage(error, undefined, errorReason);const isStreamInterrupted = isStreamInterruptedErrorMessage(error, errorReason);- const unwrappedDisplay = unwrapProviderErrorDisplay(error);const overloadRetryProgress = parseOverloadRetryProgress(error);const errorReasonI18nKey = errorReason ? ERROR_REASON_I18N_KEYS[errorReason] : undefined;const toolLoopI18nKey =@@ -295,6 +293,9 @@ export function ErrorBanner({: errorReasonI18nKey? t(errorReasonI18nKey): undefined;+ const remoteErrorCode = parseAgentErrorCode(error)?.code;+ const remoteErrorKey = remoteErrorCode ? `chat.remoteError.${remoteErrorCode}` : undefined;+ const remoteGuidance = remoteErrorKey && i18n.exists(remoteErrorKey) ? t(remoteErrorKey) : undefined;const terminalRateLimitRetryProgress = parseTerminalRateLimitRetryProgress(error, errorReason);const isCodexUsageLimitError =agentKind === 'codex' && usageLimitRecovery?.isAccountUsageLimit === true;@@ -350,7 +351,14 @@ export function ErrorBanner({// else 兜底里翻转的标志, 而不是另写一遍条件取反,保证原始错误只在通用回退时展开。let displayError: string;let hasSpecialGuidance = true;- if (isCodexResumeNotReadyProjectionError(error)) {+ if (isResponsesLiteParallelToolCallsError(error)) {+ displayError = t('chat.errorBanner.requestFormatError');+ } else if (remoteGuidance && !localizedReasonError) {+ // The bracketed code is more specific than status words in its upstream+ // fallback (for example, a transfer error can mention HTTP 502).+ displayError = remoteGuidance;+ hasSpecialGuidance = false;+ } else if (isCodexResumeNotReadyProjectionError(error)) {displayError = t('chat.errorBanner.codexResumeNotReady');} else if (isPiImageInputUnsupportedError(error)) {displayError = t('ipcError.PI_IMAGE_INPUT_UNSUPPORTED');@@ -466,10 +474,10 @@ export function ErrorBanner({// the final fallback uses the stable reason map, so auth/network/overload// recovery behavior keeps its existing priority while generic maker-core// English fallbacks are localized in both the live and tail banner.- displayError = localizedReasonError ?? unwrappedDisplay;+ displayError = localizedReasonError ?? t('chat.errorBanner.replyFailed');hasSpecialGuidance = false;}- const showUnwrappedRaw = !hasSpecialGuidance && !errorReasonI18nKey && unwrappedDisplay !== error;+ const showUnwrappedRaw = !hasSpecialGuidance || isResponsesLiteParallelToolCallsError(error);const handleSwitchToClaudeSubscription = async (): Promise<void> => {if (!onSwitchToClaudeSubscription || switchingClaudeSubscription) return;@@ -631,7 +639,7 @@ export function ErrorBanner({</button>{showRawNetworkError && (<span className="mt-0.5 block text-xs break-all opacity-70 text-[var(--error-fg)]">- {error}+ {redactSensitiveText(error)}</span>)}</>diff --git a/apps/desktop/src/renderer/components/chat/ErrorMessageCard.tsx b/apps/desktop/src/renderer/components/chat/ErrorMessageCard.tsxindex 29c7a27b7b..0a05ac230d 100644--- a/apps/desktop/src/renderer/components/chat/ErrorMessageCard.tsx+++ b/apps/desktop/src/renderer/components/chat/ErrorMessageCard.tsx@@ -8,9 +8,9 @@* 唯一交互是友好文案/协议拆封后的「查看原始错误」,与 live ErrorBanner 对齐。** 文案:errorReason 是 maker-core 的稳定 key,优先走 i18n(规则 18;与 live- * ErrorBanner 的 reason → i18n 映射同款);没有 reason 或 key 未知时,回退经- * decodeRemoteErrorMessage 解码后的 message(与 ErrorBanner 对齐,避免将- * [REMOTE_*] / [DEVICE_LINK_*] bracket code 以原始文本展示给用户)。+ * ErrorBanner 的 reason → i18n 映射同款);未知错误使用本地化摘要,+ * 脱敏后的技术原文仅在用户展开详情后显示。+ * 未发送的被拦输入由调用方显式标记,直接展示其面向用户的原因。** 视觉:走 `--error-bg` / `--error-border` / `--error-fg` 主题 token(规则 16;* 错误红属跨主题语义豁免色,token 默认值即语义红,非默认主题可按需 override),@@ -20,12 +20,11 @@import { useEffect, useState } from 'react';import { AlertCircle } from 'lucide-react';import { useTranslation } from 'react-i18next';-import { isCindyGatewayProxyTokenInvalidError } from '@cindy/maker-shared/error-redaction';+import { isCindyGatewayProxyTokenInvalidError, isResponsesLiteParallelToolCallsError, redactSensitiveText } from '@cindy/maker-shared/error-redaction';import {isStreamInterruptedErrorMessage,- unwrapProviderErrorDisplay,} from '@/utils/streamInterruptError';-import { decodeRemoteErrorMessage } from '../../lib/makerChatStore';+import { decodeRemoteErrorMessage, remoteErrorI18nKey } from '../../lib/makerChatStore';import { ERROR_REASON_I18N_KEYS } from './errorReasonI18n';import { getToolLoopI18nKey } from './toolLoopI18n';import type { ToolLoopErrorDetails } from '@cindy/maker-core';@@ -35,16 +34,21 @@ export function ErrorMessageCard({reason,providerId,toolLoop,+ kind = 'reply-error',}: {message: string;+ /** Blocked input has not reached the agent; its explanation is already user-facing. */+ kind?: 'reply-error' | 'blocked-input';reason?: string;providerId?: string;/** Structured details for a tool-loop terminal error (optional for legacy rows). */toolLoop?: ToolLoopErrorDetails;}) {- const { t } = useTranslation();+ const { t, i18n } = useTranslation();const [showRaw, setShowRaw] = useState(false);const decoded = decodeRemoteErrorMessage(message);+ const remoteKey = remoteErrorI18nKey(message);+ const remoteGuidance = remoteKey && i18n.exists(remoteKey) ? t(remoteKey) : undefined;const i18nKey = reason ? ERROR_REASON_I18N_KEYS[reason] : undefined;const isStreamInterrupted = isStreamInterruptedErrorMessage(message, reason);const isGatewayProxyTokenInvalid = isCindyGatewayProxyTokenInvalidError({@@ -52,7 +56,6 @@ export function ErrorMessageCard({message: decoded,providerId: providerId ?? null,});- const unwrapped = unwrapProviderErrorDisplay(decoded);const toolLoopI18nKey = reason === 'tool_use_loop_detected' ? getToolLoopI18nKey(toolLoop) : undefined;const localizedReasonError =toolLoopI18nKey && toolLoop@@ -60,21 +63,20 @@ export function ErrorMessageCard({: i18nKey? t(i18nKey): undefined;- const text = isStreamInterrupted- ? t('chat.errorBanner.streamInterruptedNoRetry')- : isGatewayProxyTokenInvalid- ? t('chat.errorBanner.gatewayProxyTokenInvalidNoRetry')- : localizedReasonError- ? localizedReasonError- : unwrapped;- const showRawToggle =- isStreamInterrupted ||- isGatewayProxyTokenInvalid ||- (!i18nKey && unwrapped !== decoded);+ const text = kind === 'blocked-input'+ ? redactSensitiveText(decoded)+ : isResponsesLiteParallelToolCallsError(decoded)+ ? t('chat.errorBanner.requestFormatError')+ : isStreamInterrupted+ ? t('chat.errorBanner.streamInterruptedNoRetry')+ : isGatewayProxyTokenInvalid+ ? t('chat.errorBanner.gatewayProxyTokenInvalidNoRetry')+ : localizedReasonError ?? remoteGuidance ?? t('chat.errorBanner.replyFailed');+ const showRawToggle = kind === 'reply-error' && Boolean(decoded);useEffect(() => {setShowRaw(false);- }, [message, reason]);+ }, [message, reason, kind]);if (!text) return null;return (@@ -98,7 +100,7 @@ export function ErrorMessageCard({</button>{showRaw && (<span className="mt-0.5 block text-xs break-all opacity-70 text-[var(--error-fg)]">- {decoded}+ {redactSensitiveText(message)}</span>)}</>diff --git a/apps/desktop/src/renderer/components/chat/UserMessage.tsx b/apps/desktop/src/renderer/components/chat/UserMessage.tsxindex 37e2494860..8320603914 100644--- a/apps/desktop/src/renderer/components/chat/UserMessage.tsx+++ b/apps/desktop/src/renderer/components/chat/UserMessage.tsx@@ -1797,6 +1797,7 @@ export function UserMessage({{blockedByGhost && (<div className="mt-1.5"><ErrorMessageCard+ kind="blocked-input"message={blockedByGhost.reason || t('chat.ghostHook.blockedFallback')}/></div>diff --git a/apps/desktop/src/renderer/components/chat/__tests__/ErrorBannerCodexOAuth.test.tsx b/apps/desktop/src/renderer/components/chat/__tests__/ErrorBannerCodexOAuth.test.tsxindex 634c4fb220..19c706cd6d 100644--- a/apps/desktop/src/renderer/components/chat/__tests__/ErrorBannerCodexOAuth.test.tsx+++ b/apps/desktop/src/renderer/components/chat/__tests__/ErrorBannerCodexOAuth.test.tsx@@ -523,6 +523,9 @@ describe('ErrorBanner OpenAI connection recovery', () => {/>,);+ expect(screen.getByText('chat.errorBanner.replyFailed')).toBeTruthy();+ expect(screen.queryByText('token_revoked')).toBeNull();+ fireEvent.click(screen.getByText('chat.errorBanner.networkShowRaw'));expect(screen.getByText('token_revoked')).toBeTruthy();expect(screen.queryByRole('button', { name: 'chatgptAuthRecovery.relogin' })).toBeNull();expect(screen.getByRole('button', { name: 'chat.errorBanner.retry' })).toBeTruthy();@@ -542,6 +545,9 @@ describe('ErrorBanner OpenAI connection recovery', () => {/>,);+ expect(screen.getByText('chat.errorBanner.replyFailed')).toBeTruthy();+ expect(screen.queryByText('token_revoked')).toBeNull();+ fireEvent.click(screen.getByText('chat.errorBanner.networkShowRaw'));expect(screen.getByText('token_revoked')).toBeTruthy();expect(screen.queryByRole('button', { name: 'chatgptAuthRecovery.relogin' })).toBeNull();expect(screen.getByRole('button', { name: 'chat.errorBanner.retry' })).toBeTruthy();@@ -577,6 +583,9 @@ describe('ErrorBanner OpenAI connection recovery', () => {])('does not reconnect the controller for a $label failure', (props) => {render(<ErrorBanner {...props} retryText="retry this turn" onRetry={vi.fn()} />);+ expect(screen.getByText('chat.errorBanner.replyFailed')).toBeTruthy();+ expect(screen.queryByText(props.error)).toBeNull();+ fireEvent.click(screen.getByText('chat.errorBanner.networkShowRaw'));expect(screen.getByText(props.error)).toBeTruthy();expect(screen.queryByRole('button', { name: 'chatgptAuthRecovery.relogin' })).toBeNull();expect(screen.getByRole('button', { name: 'chat.errorBanner.retry' })).toBeTruthy();@@ -1003,6 +1012,9 @@ describe('ErrorBanner OpenAI connection recovery', () => {/>,);+ expect(screen.getByText('chat.errorBanner.replyFailed')).toBeTruthy();+ expect(screen.queryByText(rawError)).toBeNull();+ fireEvent.click(screen.getByText('chat.errorBanner.networkShowRaw'));expect(screen.getByText(rawError)).toBeTruthy();expect(screen.queryByText('chat.errorBanner.codexUsageLimit')).toBeNull();expect(@@ -1040,6 +1052,9 @@ describe('ErrorBanner OpenAI connection recovery', () => {/>,);+ expect(screen.getByText('chat.errorBanner.replyFailed')).toBeTruthy();+ expect(screen.queryByText("You've hit your Claude session limit")).toBeNull();+ fireEvent.click(screen.getByText('chat.errorBanner.networkShowRaw'));expect(screen.getByText("You've hit your Claude session limit")).toBeTruthy();expect(screen.queryByText('chat.errorBanner.codexUsageLimit')).toBeNull();});diff --git a/apps/desktop/src/renderer/components/chat/__tests__/ErrorLocalization.test.tsx b/apps/desktop/src/renderer/components/chat/__tests__/ErrorLocalization.test.tsxnew file mode 100644index 0000000000..63fcaa4b09--- /dev/null+++ b/apps/desktop/src/renderer/components/chat/__tests__/ErrorLocalization.test.tsx@@ -0,0 +1,130 @@+// @vitest-environment jsdom+import { cleanup, fireEvent, render, screen, act } from '@testing-library/react';+import { afterEach, describe, expect, it, vi } from 'vitest';+import { createInstance } from 'i18next';+import { I18nextProvider } from 'react-i18next';+import { SUPPORTED_LOCALES } from '../../../../shared/locale';+import en from '@/i18n/locales/en/common.json';+import zhCN from '@/i18n/locales/zh-CN/common.json';+import zhTW from '@/i18n/locales/zh-TW/common.json';+import ja from '@/i18n/locales/ja/common.json';+import ko from '@/i18n/locales/ko/common.json';++vi.mock('@/components/ui/confirm-dialog-provider', () => ({ useConfirmDialog: () => ({ confirm: vi.fn() }) }));+vi.mock('@/hooks/useCodexRuntimeRoute', () => ({ useCodexRuntimeRoute: () => ({ authInjection: 'env-key' }) }));+vi.mock('@/hooks/useCodexSessionExpiredPrompt', () => ({ isCodexSessionExpiredError: () => false, useCodexSessionExpiredPrompt: () => vi.fn() }));+vi.mock('@/hooks/useProviders', () => ({ useProviders: () => ({ providers: [], refetch: vi.fn() }) }));+vi.mock('@/hooks/useCodexAuth', () => ({ useCodexAuth: () => ({ state: { kind: 'disconnected' } }), isChatGptConnectionConnected: () => false }));+import { ErrorBanner } from '../ErrorBanner';+import { ErrorMessageCard } from '../ErrorMessageCard';+import { ErrorTailErrorBanner } from '../InterruptedTurnBanner';+import { remoteErrorMessageForBanner } from '@/lib/makerChatStore';++const locales = { en, 'zh-CN': zhCN, 'zh-TW': zhTW, ja, ko };+const raw = JSON.stringify({ error: {+ message: 'X-OpenAI-Internal-Codex-Responses-Lite requires `parallel_tool_calls` to be false.',+ type: 'invalid_request_error', code: 'unsupported_value', param: 'parallel_tool_calls',+} });+afterEach(cleanup);++describe.each(SUPPORTED_LOCALES)('error presentation in %s', locale => {+ it('keeps the localized blocked-input fallback visible instead of a reply-failure summary', async () => {+ const i18n = createInstance();+ await i18n.init({ lng: locale, fallbackLng: 'en', resources: Object.fromEntries(Object.entries(locales).map(([lng, common]) => [lng, { translation: common }])) });+ render(<I18nextProvider i18n={i18n}><ErrorMessageCard kind="blocked-input" message={i18n.t('chat.ghostHook.blockedFallback')} /></I18nextProvider>);+ expect(screen.getByText(locales[locale].chat.ghostHook.blockedFallback)).toBeTruthy();+ expect(screen.queryByText(locales[locale].chat.errorBanner.replyFailed)).toBeNull();+ expect(screen.queryByText(locales[locale].chat.errorBanner.networkShowRaw)).toBeNull();+ });++ it.each(['REMOTE_LOCAL_ONLY_PROVIDER', 'DEVICE_LINK_MEDIA_TRANSFER_FAILED', 'MCP_APPROVAL_CONFIRMATION_TIMEOUT'])('preserves curated %s guidance and follows language changes', async code => {+ const i18n = createInstance();+ await i18n.init({ lng: locale, fallbackLng: 'en', resources: Object.fromEntries(Object.entries(locales).map(([lng, common]) => [lng, { translation: common }])) });+ const message = `Error invoking remote method device-link:invoke: Error: [${code}] upstream fallback api_key=private-test-value`;+ render(<I18nextProvider i18n={i18n}><ErrorMessageCard message={message} /></I18nextProvider>);+ const expected = locales[locale].chat.remoteError[code as keyof typeof en.chat.remoteError];+ expect(typeof expected).toBe('string');+ expect(screen.getByText(expected)).toBeTruthy();+ expect(screen.queryByText(i18n.t('chat.errorBanner.replyFailed'))).toBeNull();+ expect(screen.queryByText(/upstream fallback/)).toBeNull();+ fireEvent.click(screen.getByText(i18n.t('chat.errorBanner.networkShowRaw')));+ expect(screen.getByText(/upstream fallback/).textContent).toContain('[REDACTED]');+ expect(screen.queryByText(/private-test-value/)).toBeNull();+ const next = locale === 'en' ? 'ja' : 'en';+ await act(async () => { await i18n.changeLanguage(next); });+ expect(screen.getByText(i18n.t(`chat.remoteError.${code}`))).toBeTruthy();+ expect(screen.queryByText(locales[locale].chat.remoteError[code as keyof typeof en.chat.remoteError])).toBeNull();+ });++ it.each(['live', 'tail'] as const)('keeps known remote recovery guidance in the %s banner across language changes', async surface => {+ const i18n = createInstance();+ await i18n.init({ lng: locale, fallbackLng: 'en', resources: Object.fromEntries(Object.entries(locales).map(([lng, common]) => [lng, { translation: common }])) });+ const code = 'REMOTE_LOCAL_ONLY_PROVIDER';+ const rawRemoteError = `[${code}] upstream HTTP 502 api_key=private-test-value`;+ const bannerError = remoteErrorMessageForBanner(rawRemoteError);+ expect(bannerError).toContain(`[${code}]`);+ render(<I18nextProvider i18n={i18n}>{surface === 'live'+ ? <ErrorBanner error={bannerError} onRetry={vi.fn()} />+ : <ErrorTailErrorBanner errorText={bannerError} onContinue={vi.fn()} onDismiss={vi.fn()} />}</I18nextProvider>);+ expect(screen.getByText(locales[locale].chat.remoteError[code])).toBeTruthy();+ expect(screen.queryByText(locales[locale].chat.errorBanner.replyFailed)).toBeNull();+ expect(screen.queryByText(rawRemoteError)).toBeNull();+ fireEvent.click(screen.getByText(locales[locale].chat.errorBanner.networkShowRaw));+ expect(screen.getByText(/upstream HTTP 502/).textContent).toContain('[REDACTED]');+ expect(screen.queryByText(/private-test-value/)).toBeNull();+ const next = locale === 'en' ? 'ja' : 'en';+ await act(async () => { await i18n.changeLanguage(next); });+ expect(screen.getByText(locales[next].chat.remoteError[code])).toBeTruthy();+ expect(screen.queryByText(locales[locale].chat.remoteError[code])).toBeNull();+ });++ it('does not mistake an unknown remote-code fallback for localized guidance', async () => {+ const i18n = createInstance();+ await i18n.init({ lng: locale, fallbackLng: 'en', resources: { [locale]: { translation: locales[locale] } } });+ render(<I18nextProvider i18n={i18n}><ErrorMessageCard message="[REMOTE_UNKNOWN] Arbitrary English diagnostics" /></I18nextProvider>);+ expect(screen.getByText(locales[locale].chat.errorBanner.replyFailed)).toBeTruthy();+ expect(screen.queryByText(/Arbitrary English/)).toBeNull();+ });++ it.each(['live', 'tail', 'history'] as const)('localizes %s and keeps diagnostics collapsed, with existing recovery', async surface => {+ const i18n = createInstance();+ await i18n.init({ lng: locale, fallbackLng: 'en', resources: Object.fromEntries(Object.entries(locales).map(([lng, common]) => [lng, { translation: common }])) });+ const retry = vi.fn();+ render(<I18nextProvider i18n={i18n}>{surface === 'live'+ ? <ErrorBanner error={raw} retryText="original-welcome" onRetry={retry} />+ : surface === 'tail'+ ? <ErrorTailErrorBanner errorText={raw} onContinue={retry} onDismiss={vi.fn()} />+ : <ErrorMessageCard message={raw} />}</I18nextProvider>);+ const copy = locales[locale].chat.errorBanner;+ expect(screen.getByText(copy.requestFormatError)).toBeTruthy();+ expect(screen.queryByText(raw)).toBeNull();+ expect(retry).not.toHaveBeenCalled();+ fireEvent.click(screen.getByText(copy.networkShowRaw));+ expect(screen.getByText(raw)).toBeTruthy();+ fireEvent.click(screen.getByText(copy.networkHideRaw));+ expect(screen.queryByText(raw)).toBeNull();+ if (surface !== 'history') {+ fireEvent.click(screen.getByTitle(copy.retryTitle));+ expect(retry).toHaveBeenCalledTimes(1);+ if (surface === 'live') expect(retry).toHaveBeenCalledWith('original-welcome');+ }+ const next = locale === 'en' ? 'ja' : 'en';+ await act(async () => { await i18n.changeLanguage(next); });+ expect(screen.getByText(locales[next].chat.errorBanner.requestFormatError)).toBeTruthy();+ expect(screen.getByText(locales[next].chat.errorBanner.networkShowRaw)).toBeTruthy();+ });++ it.each(['live', 'history'] as const)('hides unknown English errors and redacts details in %s', async surface => {+ const i18n = createInstance();+ await i18n.init({ lng: locale, fallbackLng: 'en', resources: { [locale]: { translation: locales[locale] } } });+ const error = 'Unexpected provider failure; api_key=private-test-value';+ render(<I18nextProvider i18n={i18n}>{surface === 'live'+ ? <ErrorBanner error={error} onRetry={vi.fn()} />+ : <ErrorMessageCard message={error} />}</I18nextProvider>);+ expect(screen.getByText(locales[locale].chat.errorBanner.replyFailed)).toBeTruthy();+ expect(screen.queryByText(/Unexpected provider/)).toBeNull();+ fireEvent.click(screen.getByText(locales[locale].chat.errorBanner.networkShowRaw));+ expect(screen.getByText(/Unexpected provider failure/).textContent).toContain('[REDACTED]');+ expect(screen.queryByText(/private-test-value/)).toBeNull();+ });+});diff --git a/apps/desktop/src/renderer/components/chat/__tests__/ErrorMessageCard.test.tsx b/apps/desktop/src/renderer/components/chat/__tests__/ErrorMessageCard.test.tsxindex 4f78eb42cd..90fc3685ca 100644--- a/apps/desktop/src/renderer/components/chat/__tests__/ErrorMessageCard.test.tsx+++ b/apps/desktop/src/renderer/components/chat/__tests__/ErrorMessageCard.test.tsx@@ -18,6 +18,15 @@ const STREAM_RAW =afterEach(cleanup);describe('ErrorMessageCard', () => {+ it('shows a blocked input explanation directly without treating it as a failed reply', () => {+ const message = 'Please remove the credential before sending: api_key=private-test-value';+ render(createElement(ErrorMessageCard, { kind: 'blocked-input', message }));+ expect(screen.getByText('Please remove the credential before sending: api_key=[REDACTED]')).toBeTruthy();+ expect(screen.queryByText(/private-test-value/)).toBeNull();+ expect(screen.queryByText('chat.errorBanner.replyFailed')).toBeNull();+ expect(screen.queryByText('chat.errorBanner.networkShowRaw')).toBeNull();+ });+it('uses the same model access guidance for persisted failures as the live banner', () => {render(createElement(ErrorMessageCard, {message: 'Failed to authenticate. API Error: 403 user not allowed to access model',@@ -67,18 +76,20 @@ describe('ErrorMessageCard', () => {expect(screen.queryByText('logic.errors.toolUseLoopDetectedWithCount')).toBeNull();});- it('keeps genuine OpenAI errors as-is without an expander', () => {+ it('keeps unknown provider errors in details behind a localized summary', () => {const raw = 'OpenAI API error (400): invalid_prompt';render(createElement(ErrorMessageCard, { message: raw }));+ expect(screen.getByText('chat.errorBanner.replyFailed')).toBeTruthy();+ expect(screen.queryByText(raw)).toBeNull();+ fireEvent.click(screen.getByText('chat.errorBanner.networkShowRaw'));expect(screen.getByText(raw)).toBeTruthy();- expect(screen.queryByText('chat.errorBanner.networkShowRaw')).toBeNull();});- it('unwraps LiteLLM envelopes and still offers the original', () => {+ it('localizes LiteLLM envelopes and still offers the original', () => {const raw ='OpenAI API error (400): {"message":"litellm.BadRequestError: XaiException - too long"}';render(createElement(ErrorMessageCard, { message: raw }));- expect(screen.getByText('XaiException - too long')).toBeTruthy();+ expect(screen.getByText('chat.errorBanner.replyFailed')).toBeTruthy();expect(screen.queryByText(raw)).toBeNull();fireEvent.click(screen.getByText('chat.errorBanner.networkShowRaw'));expect(screen.getByText(raw)).toBeTruthy();@@ -97,7 +108,7 @@ describe('ErrorMessageCard', () => {code: '400',})}`;render(createElement(ErrorMessageCard, { message: raw }));- expect(screen.getByText('Upstream rejected the request!')).toBeTruthy();+ expect(screen.getByText('chat.errorBanner.replyFailed')).toBeTruthy();expect(screen.queryByText(raw)).toBeNull();fireEvent.click(screen.getByText('chat.errorBanner.networkShowRaw'));expect(screen.getByText(raw)).toBeTruthy();diff --git a/apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx b/apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsxindex 1ea6813814..8249af5bc6 100644--- a/apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx+++ b/apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx@@ -206,7 +206,7 @@ import type { Session } from '@/lib/ccAgent.types';import { toast } from '@/lib/toast';import {buildCreateOptsForCurrentSession,- decodeRemoteErrorMessage,+ remoteErrorMessageForBanner,makerChatStore,type AgentTaskUpdate,type MessageDeliveryMode,@@ -2105,14 +2105,14 @@ export function CCAgentSessionView({syntheticContinuationQueued || continuationInFlightClientId !== null;const errorTailKind: 'interrupted' | 'error' =errorTailMsg?.errorReason === APP_EXIT_INTERRUPTED_REASON ? 'interrupted' : 'error';- // 普通失败行传给 ErrorBanner 的错误文本:**保持 raw**(只解码 [REMOTE_*]- // bracket code,不做 reason→i18n 转换,review P2)—— ErrorBanner 的门控判定+ // 普通失败行传给 ErrorBanner 的错误文本:**保持 raw**(包括可识别的+ // bracket code,由 ErrorBanner 按当前语言翻译)—— ErrorBanner 的门控判定// (codex thread not found / 401 / invalid-encrypted 等)靠对原文的正则命中,// i18n 化会让不可重试错误漏过门控;live 报错时 banner 显示的本来也是 raw// message,重载后同文案反而更一致。const errorTailText = useMemo(() => {if (!errorTailMsg || errorTailKind !== 'error') return '';- return decodeRemoteErrorMessage(errorTailMsg.content);+ return remoteErrorMessageForBanner(errorTailMsg.content);}, [errorTailKind, errorTailMsg]);// 本地隐藏态:点主按钮后立即隐藏,不等新消息入流(视觉连续性,规则 7)。// 「忽略/关闭」走 store 的乐观 errorDismissed 更新,无需本地态。diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.jsonindex d83485eccc..32cb7b281a 100644--- a/apps/desktop/src/renderer/i18n/locales/en/common.json+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json@@ -8990,6 +8990,8 @@"failed": "Couldn't generate the image — try again"},"errorBanner": {+ "requestFormatError": "The app sent an invalid request, so this reply could not be completed.",+ "replyFailed": "This reply could not be completed. Check the error details for more information.","retryTitle": "Resend the last message","cancelTitle": "Dismiss error","retry": "Retry",diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.jsonindex 6249c41593..2db64acac7 100644--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json@@ -8984,6 +8984,8 @@"failed": "画像を生成できませんでした。もう一度お試しください"},"errorBanner": {+ "requestFormatError": "アプリが送信したリクエストの形式に問題があり、返信を完了できませんでした。",+ "replyFailed": "返信を完了できませんでした。原因を確認するには、エラーの詳細をご覧ください。","retryTitle": "最後のメッセージを再送信","cancelTitle": "エラーを閉じる","retry": "再試行",diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.jsonindex 22d2a19c4c..c5f97e81c1 100644--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json@@ -8984,6 +8984,8 @@"failed": "이미지를 생성하지 못했습니다. 다시 시도해 주세요"},"errorBanner": {+ "requestFormatError": "앱이 보낸 요청 형식에 문제가 있어 답변을 완료하지 못했습니다.",+ "replyFailed": "답변을 완료하지 못했습니다. 오류 세부 정보에서 원인을 확인하세요.","retryTitle": "마지막 메시지 다시 보내기","cancelTitle": "오류 알림 닫기","retry": "다시 시도",diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.jsonindex 3c06b5f93d..3d05ab2c5b 100644--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json@@ -8984,6 +8984,8 @@"failed": "图片生成失败,请重试"},"errorBanner": {+ "requestFormatError": "应用发送的请求格式有误,本次回复未能完成。",+ "replyFailed": "本次回复未能完成。请查看错误详情以了解原因。","retryTitle": "重新发送最后一条消息","cancelTitle": "关闭错误提示","retry": "重试",diff --git a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.jsonindex 40e510f1ac..5d3fd8218a 100644--- a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json@@ -8983,6 +8983,8 @@"failed": "圖片生成失敗,請重試"},"errorBanner": {+ "requestFormatError": "應用程式送出的請求格式有誤,本次回覆未能完成。",+ "replyFailed": "本次回覆未能完成。請查看錯誤詳情以瞭解原因。","retryTitle": "重新傳送最後一條訊息","cancelTitle": "關閉錯誤提示","retry": "重試",diff --git a/apps/desktop/src/renderer/lib/makerChatStore.ts b/apps/desktop/src/renderer/lib/makerChatStore.tsindex a7523097d2..9567bbd064 100644--- a/apps/desktop/src/renderer/lib/makerChatStore.ts+++ b/apps/desktop/src/renderer/lib/makerChatStore.ts@@ -51,6 +51,7 @@ import {isCindyGatewayProviderId,isGatewayProxyTokenInvalidError,redactSensitiveText,+ parseAgentErrorCode,} from '@cindy/maker-shared/error-redaction';import {formatRemoteError,@@ -217,31 +218,6 @@ const MAX_REMOTE_AUTH_RETRIES = 2;const CLEAR_SESSION_GUARD_TIMEOUT_MS = 500;const REMOTE_CONTENT_TRUNCATED_PLACEHOLDER = '[remote content truncated: payload too large]';-/**- * maker-core 远端分支把不可恢复的远端错误编码成 `[REMOTE_*] 英文兜底文案` 的- * message(见 packages/maker-core/src/agents/claude-code/index.ts)。renderer- * 直接显示会裸露英文 code,这里把已知 code 映射成 i18n 文案(规则 17)。未知- * code / 漏翻时回退到去掉 `[CODE]` 前缀的英文原文,绝不把 `[REMOTE_*]` 显给用户。- */-const BRACKET_ERROR_CODE_RE = /(?:^|: Error: )\[([A-Z0-9_]+)\]\s*([\s\S]*)$/;-const REMOTE_ERROR_CODE_RE = /(?:^|: Error: )\[(REMOTE_[A-Z_]+)\]\s*([\s\S]*)$/;-const DEVICE_LINK_CHAT_ERROR_CODES: ReadonlySet<string> = new Set([- 'DEVICE_LINK_CONTROL_DISABLED',- 'DEVICE_LINK_MEDIA_TRANSFER_FAILED',-] as const);-/**- * 非 `REMOTE_*` / 非 device-link 的会话级提示码 —— agent runtime 用同一套- * `[CODE] fallback text` 约定把「这件事用户该知道」告诉 renderer,不新增事件类型。- * 未登记的 code 仍然回退到英文兜底文案(绝不把 `[CODE]` 裸露给用户)。- */-const AGENT_RUNTIME_CHAT_ERROR_CODES: ReadonlySet<string> = new Set([- // Distinguish review availability, blocked calls, and missing confirmations.- 'AUTO_REVIEW_UNAVAILABLE',- 'AUTO_REVIEW_CONFIRM_UNDELIVERED',- 'MCP_APPROVAL_AUTO_BLOCKED',- 'MCP_APPROVAL_CONFIRMATION_TIMEOUT',- 'MCP_APPROVAL_CONFIRMATION_UNAVAILABLE',-] as const);const REMOTE_HEAVY_INBOUND_CHANNELS: ReadonlySet<string> = new Set([SESSION_SYNC_CHANNEL,'maker:event',@@ -329,22 +305,24 @@ function resolveEstimatedTurnCostUsd(: rawCostUsd;}+/** Translation candidate only; callers must check their active i18n resources.+ * Unknown-code fallback text is diagnostic content, not curated guidance. */+export function remoteErrorI18nKey(msg: string): string | undefined {+ const parsed = parseAgentErrorCode(msg);+ return parsed ? `chat.remoteError.${parsed.code}` : undefined;+}+export function decodeRemoteErrorMessage(msg: string): string {- const bracketMatch = BRACKET_ERROR_CODE_RE.exec(msg);- const bracketCode = bracketMatch?.[1];- if (- bracketCode &&- (DEVICE_LINK_CHAT_ERROR_CODES.has(bracketCode) ||- AGENT_RUNTIME_CHAT_ERROR_CODES.has(bracketCode))- ) {- return i18n.t(`chat.remoteError.${bracketCode}`, {- defaultValue: bracketMatch[2] || msg,- });- }- const m = REMOTE_ERROR_CODE_RE.exec(msg);- if (!m) return msg;- const fallback = m[2] || msg;- return i18n.t(`chat.remoteError.${m[1]}`, { defaultValue: fallback });+ const parsed = parseAgentErrorCode(msg);+ return parsed+ ? i18n.t(`chat.remoteError.${parsed.code}`, { defaultValue: parsed.fallback })+ : msg;+}++/** Keep known codes for the banner's active locale; retain unknown-code fallback behavior. */+export function remoteErrorMessageForBanner(msg: string): string {+ const key = remoteErrorI18nKey(msg);+ return key && i18n.exists(key) ? msg : decodeRemoteErrorMessage(msg);}// 专门给"出现在用户面前的红色 ErrorBanner"打日志,scope 以 `maker/` 开头// 是为了让它落在统一 agent 流(agent-*.ndjson,跟 agent runtime 抛出的底层错误同一份,@@ -6179,7 +6157,7 @@ export function handleStreamEvent(? i18n.t('logic.errors.silentStopExhausted'): reason === 'codex-auto-review-unavailable'? i18n.t('logic.errors.codexAutoReviewUnavailable')- : decodeRemoteErrorMessage(safeErrMsg);+ : remoteErrorMessageForBanner(safeErrMsg);const isTerminalError = isTerminalErrorData(event.data);// 终态错误 = turn 收口(含失败):清掉该 session 的「正在识别图片中」toast,// 避免视觉桥未输出就终结时 loading toast 残留(done/abort/terminal error 兜底)。diff --git a/apps/mobile/src/__tests__/AgentErrorLocalization.test.tsx b/apps/mobile/src/__tests__/AgentErrorLocalization.test.tsxnew file mode 100644index 0000000000..5b6721045d--- /dev/null+++ b/apps/mobile/src/__tests__/AgentErrorLocalization.test.tsx@@ -0,0 +1,162 @@+// @vitest-environment jsdom+import { act, type ReactNode } from 'react';+import { readFileSync } from 'node:fs';+import { parseAgentErrorCode } from '@cindy/maker-shared/error-redaction';+import { unclassifiedAgentErrorI18nKey, requiresAgentErrorConfigurationChange } from '@/session/agentErrorI18n';+import { createRoot, type Root } from 'react-dom/client';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { i18n } from '@/i18n';+import { SUPPORTED_LOCALES } from '@/i18n/locale';+import { InlineQueueSection } from '@/session/InlineQueueSection';+import { SessionTailBanner } from '@/session/SessionTailBanner';+import { AgentErrorDetails } from '@/session/AgentErrorDetails';+import { resolveSessionTailBanner } from '@/session/sessionTailBannerModel';+import { normalizeRemoteMessages } from '@/session/messageNormalize';+import type { InputProjection, RemoteMessage } from '@/session/types';++vi.mock('react-native', async () => {+ const { createElement } = await import('react');+ const view = (tag: string) => ({ children, onPress, disabled, testID, accessibilityState }: {+ children?: ReactNode; onPress?: () => void; disabled?: boolean; testID?: string; accessibilityState?: { expanded?: boolean };+ }) => createElement(tag, { onClick: onPress, disabled, 'data-testid': testID, 'aria-expanded': accessibilityState?.expanded }, children);+ return { View: view('div'), Text: view('span'), Pressable: view('button'), ActivityIndicator: () => null,+ StyleSheet: { create: (s: unknown) => s, hairlineWidth: 1 } };+});+vi.mock('@/components/AppText', async () => ({ Text: (await import('react-native')).Text }));+vi.mock('lucide-react-native', () => ({ Pause: () => null, Play: () => null }));+vi.mock('@/theme', async () => {+ const tokens = await import('@/theme/tokens');+ return { ...tokens, useTheme: () => ({ colors: tokens.lightColors }),+ useThemedStyles: (make: (colors: typeof tokens.lightColors) => unknown) => make(tokens.lightColors) };+});+const raw = JSON.stringify({ error: { message: 'X-OpenAI-Internal-Codex-Responses-Lite requires `parallel_tool_calls` to be false.', type: 'invalid_request_error', param: 'parallel_tool_calls', code: 'unsupported_value' } });+let root: Root;+let host: HTMLDivElement;+beforeEach(() => {+ Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true });+ host = document.createElement('div'); root = createRoot(host);+});+afterEach(() => act(() => root.unmount()));+const row = (text: string): RemoteMessage => ({ id: 'error', clientId: 'error', sessionId: 's', role: 'error', content: JSON.stringify({ message: text }), toolUseId: null, agentMeta: null, createdAt: '2026-09-23T04:13:00Z' });+const clickText = (text: string) => {+ const button = [...host.querySelectorAll('button')].find(b => b.textContent === text);+ expect(button).toBeTruthy(); button!.click();+};++describe.each(SUPPORTED_LOCALES)('mobile errors in %s', locale => {+ it.each(['live', 'tail'] as const)('localizes %s, preserves retry and switches locale without another request', async surface => {+ await i18n.changeLanguage(locale);+ for (const key of ['requestFormatError', 'replyFailed', 'showErrorDetails', 'hideErrorDetails', 'retry']) {+ expect(i18n.getResource(locale, 'common', `session.tail.${key}`)).toBeTypeOf('string');+ }+ const retry = vi.fn();+ const state = resolveSessionTailBanner({ messages: [row(raw)], session: null, projection: { error: null, credentialSwitchWait: null }, isSessionStreaming: false, continuationInFlight: false, sessionMetadataSyncedForConnection: true, interruptAcked: false, hiddenErrorClientIds: new Set() });+ expect(state?.kind).toBe('error-tail');+ await act(async () => root.render(surface === 'live'+ ? <InlineQueueSection projection={{ error: raw, errorRetryText: 'original-welcome' } as InputProjection} readOnlyReason={null} errorRecoveryReadOnlyReason={null} onRetryError={retry} onClearError={vi.fn()} onResume={vi.fn()} />+ : <SessionTailBanner state={state!} onContinue={retry} onDismiss={vi.fn()} />));+ expect(host.textContent).toContain(i18n.t('session.tail.requestFormatError'));+ expect(host.textContent).not.toContain('Responses-Lite');+ expect(retry).not.toHaveBeenCalled();+ await act(async () => clickText(i18n.t('session.tail.showErrorDetails')));+ expect(host.textContent).toContain(raw);+ await act(async () => clickText(i18n.t('session.tail.hideErrorDetails')));+ const next = locale === 'en' ? 'ja' : 'en';+ await act(async () => { await i18n.changeLanguage(next); });+ expect(host.textContent).toContain(i18n.t('session.tail.requestFormatError'));+ expect(host.textContent).toContain(i18n.t('session.tail.showErrorDetails'));+ const retryButton = host.querySelector<HTMLButtonElement>(`[data-testid="${surface === 'live' ? 'queue.inline.retryButton' : 'session.tailBanner.continue'}"]`)!;+ await act(async () => retryButton.click());+ expect(retry).toHaveBeenCalledOnce();+ });++ it('localizes historical errors and only discloses redacted unknown diagnostics', async () => {+ await i18n.changeLanguage(locale);+ const [lite, unknown] = normalizeRemoteMessages([row(raw), { ...row('Provider exploded; api_key=private-test-value'), id: 'unknown', clientId: 'unknown' }]);+ expect(lite.body).toBe(i18n.t('session.tail.requestFormatError'));+ expect(unknown.body).toBe(i18n.t('session.tail.replyFailed'));+ await act(async () => root.render(<AgentErrorDetails message={unknown.rawError!} />));+ expect(host.textContent).not.toContain('Provider exploded');+ await act(async () => clickText(i18n.t('session.tail.showErrorDetails')));+ expect(host.textContent).toContain('Provider exploded');+ expect(host.textContent).toContain('[REDACTED]');+ expect(host.textContent).not.toContain('private-test-value');+ });+});+++describe.each(SUPPORTED_LOCALES)('known mobile remote errors in %s', locale => {+ it('has every desktop bracket-code translation without relying on fallback languages', async () => {+ await i18n.changeLanguage(locale);+ const desktop = JSON.parse(readFileSync(`../desktop/src/renderer/i18n/locales/${locale}/common.json`, 'utf8'));+ for (const [code, translation] of Object.entries(desktop.chat.remoteError)) {+ if (!parseAgentErrorCode(`[${code}] diagnostic`)) continue;+ const key = `session.remoteError.${code}`;+ const translated = i18n.getResource(locale, 'common', key);+ expect(translated).toBeTypeOf('string');+ expect(translated.length).toBeGreaterThan(0);+ expect(translated.match(/{{[^}]+}}/g) ?? []).toEqual((translation as string).match(/{{[^}]+}}/g) ?? []);+ expect(unclassifiedAgentErrorI18nKey(`[${code}] diagnostic`)).toBe(key);+ }+ expect(unclassifiedAgentErrorI18nKey('[REMOTE_FUTURE] private diagnostic')).toBe('session.tail.replyFailed');+ expect(unclassifiedAgentErrorI18nKey('[CUSTOM_ERROR] private diagnostic')).toBe('session.tail.replyFailed');+ });++ it.each(['REMOTE_LOCAL_ONLY_PROVIDER', 'DEVICE_LINK_MEDIA_TRANSFER_FAILED', 'MCP_APPROVAL_CONFIRMATION_TIMEOUT'])(+ 'preserves %s guidance across history, live and tail, including language changes', async code => {+ await i18n.changeLanguage(locale);+ const message = `Error invoking remote method 'maker:send': Error: [${code}] upstream diagnostic; api_key=private-test-value`;+ const key = `session.remoteError.${code}`;+ const [historical] = normalizeRemoteMessages([row(message)]);+ expect(historical.body).toBe(i18n.t(key));+ expect(historical.errorSummaryKey).toBe(key);+ expect(historical.rawError).toBe(message);+ const state = resolveSessionTailBanner({ messages: [row(message)], session: null, projection: { error: null, credentialSwitchWait: null }, isSessionStreaming: false, continuationInFlight: false, sessionMetadataSyncedForConnection: true, interruptAcked: false, hiddenErrorClientIds: new Set() });+ expect(state?.kind).toBe('error-tail');+ const retryable = code !== 'REMOTE_LOCAL_ONLY_PROVIDER';+ expect(state?.kind === 'error-tail' && state.retryable).toBe(retryable);+ for (const surface of ['live', 'tail'] as const) {+ await i18n.changeLanguage(locale);+ const retry = vi.fn();+ const clear = vi.fn();+ await act(async () => root.render(surface === 'live'+ ? <InlineQueueSection projection={{ error: message, errorRetryText: 'original user message' } as InputProjection} readOnlyReason={null} errorRecoveryReadOnlyReason={null} onRetryError={retry} onClearError={clear} onResume={vi.fn()} />+ : <SessionTailBanner state={state!} onContinue={retry} onDismiss={clear} />));+ expect(host.textContent).toContain(i18n.t(key));+ expect(host.textContent).not.toContain('upstream diagnostic');+ expect(host.textContent).not.toContain(i18n.t('session.tail.replyFailed'));+ await act(async () => clickText(i18n.t('session.tail.showErrorDetails')));+ expect(host.textContent).toContain('upstream diagnostic');+ expect(host.textContent).not.toContain('private-test-value');+ await act(async () => clickText(i18n.t('session.tail.hideErrorDetails')));+ await act(async () => { await i18n.changeLanguage(locale === 'en' ? 'ja' : 'en'); });+ expect(host.textContent).toContain(i18n.t(key));+ expect(host.textContent).toContain(i18n.t('session.tail.showErrorDetails'));+ const retryButton = host.querySelector<HTMLButtonElement>(`[data-testid="${surface === 'live' ? 'queue.inline.retryButton' : 'session.tailBanner.continue'}"]`);+ if (retryable) {+ expect(retryButton).toBeTruthy();+ await act(async () => retryButton!.click());+ expect(retry).toHaveBeenCalledOnce();+ } else {+ expect(retryButton).toBeNull();+ expect(retry).not.toHaveBeenCalled();+ }+ const clearButton = host.querySelector<HTMLButtonElement>(`[data-testid="${surface === 'live' ? 'queue.inline.clearErrorButton' : 'session.tailBanner.dismiss'}"]`);+ expect(clearButton).toBeTruthy();+ await act(async () => clearButton!.click());+ expect(clear).toHaveBeenCalledOnce();+ }+ },+ );+});++it.each(['REMOTE_LOCAL_ONLY_PROVIDER', 'REMOTE_COMPAT_MODE_UNSUPPORTED', 'REMOTE_LOCAL_ATTACHMENT_UNSUPPORTED', 'DEVICE_LINK_CONTROL_DISABLED'])(+ 'does not suggest resending unchanged content for %s', code => {+ expect(requiresAgentErrorConfigurationChange(`[${code}] diagnostic`)).toBe(true);+ },+);+it.each(['REMOTE_DAEMON_CLOSED', 'REMOTE_GATEWAY_ENDPOINT_UNAVAILABLE', 'DEVICE_LINK_MEDIA_TRANSFER_FAILED', 'MCP_APPROVAL_CONFIRMATION_TIMEOUT', 'REMOTE_FUTURE'])(+ 'preserves retry for recoverable or unclassified %s', code => {+ expect(requiresAgentErrorConfigurationChange(`[${code}] diagnostic`)).toBe(false);+ },+);diff --git a/apps/mobile/src/__tests__/messageNormalize.test.ts b/apps/mobile/src/__tests__/messageNormalize.test.tsindex 97be29e74c..dfddaacbf7 100644--- a/apps/mobile/src/__tests__/messageNormalize.test.ts+++ b/apps/mobile/src/__tests__/messageNormalize.test.ts@@ -1035,8 +1035,9 @@ describe('normalizeRemoteMessages', () => {expect(items[0]).toMatchObject({ kind: 'system', label: 'error' });expect(items[0].body).toContain('还没有配置可用的 API Key');expect(items[0].body).toContain('设置 → 模型供应商');- // 非鉴权错误维持原文- expect(items[1].body).toBe('something exploded');+ // 未分类错误使用本地化摘要,技术原文留给详情。+ expect(items[1].body).toBe(i18n.t('session.tail.replyFailed'));+ expect(items[1].rawError).toBe('something exploded');});it('localizes a persisted output limit in message history', () => {diff --git a/apps/mobile/src/__tests__/sessionTailBannerModel.test.ts b/apps/mobile/src/__tests__/sessionTailBannerModel.test.tsindex b68434f44d..966518f719 100644--- a/apps/mobile/src/__tests__/sessionTailBannerModel.test.ts+++ b/apps/mobile/src/__tests__/sessionTailBannerModel.test.ts@@ -55,7 +55,9 @@ describe('resolveSessionTailBanner — error-tail', () => {expect(state).toEqual({kind: 'error-tail',clientId: 'e1',- text: 'process exited unexpectedly',+ text: i18n.t('session.tail.replyFailed'),+ rawError: 'process exited unexpectedly',+ summaryKey: 'session.tail.replyFailed',continueKind: 'error',retryable: true,});diff --git a/apps/mobile/src/i18n/locales/en/session.json b/apps/mobile/src/i18n/locales/en/session.jsonindex 48b6588246..47c774a147 100644--- a/apps/mobile/src/i18n/locales/en/session.json+++ b/apps/mobile/src/i18n/locales/en/session.json@@ -476,6 +476,10 @@"deleteOne": "Delete this message"},"tail": {+ "requestFormatError": "The app sent an invalid request, so this reply could not be completed.",+ "replyFailed": "This reply could not be completed. Check the error details for more information.",+ "showErrorDetails": "Show Error Details",+ "hideErrorDetails": "Hide Error Details","interrupted": "The app exited mid-task, so it was interrupted.","continueTask": "Continue Task","retry": "Retry",@@ -512,5 +516,19 @@"restoreFailed": "Saved messages could not be restored. They have not been deleted. Restart the app and try again.","recoveryTarget": "Keep the original computer while recovering this task. Its later messages are still saved.","taskAlreadyCreated": "This task already exists on the computer. Its saved messages will resume there."+ },+ "remoteError": {+ "REMOTE_DAEMON_CLOSED": "Remote connection interrupted (the daemon may be upgrading or restarting). The turn has ended — please resend.",+ "REMOTE_LOCAL_ATTACHMENT_UNSUPPORTED": "Local file/image attachments aren't accessible in remote sessions. Paste the content directly instead.",+ "AUTO_REVIEW_UNAVAILABLE": "Auto-review could not reach a decision (network or service hiccup), so actions that need review are being handed to you to confirm. Switch this task to Default permissions if you would rather not be interrupted.",+ "AUTO_REVIEW_CONFIRM_UNDELIVERED": "Automatic review was unavailable, and the confirmation request was not completed. This is not a user rejection.",+ "REMOTE_COMPAT_MODE_UNSUPPORTED": "Remote Claude Code sessions can't route through the local compat proxy (internal error).",+ "REMOTE_GATEWAY_ENDPOINT_UNAVAILABLE": "Cindy AI credentials are not ready yet (issued automatically after sign-in). Please retry shortly; if this persists, check the Cindy AI status in Settings → Model Providers.",+ "REMOTE_LOCAL_ONLY_PROVIDER": "This model provider is a local-only service (e.g. Ollama) that a remote SSH task cannot reach. Switch to the Cindy AI gateway, or pick a provider reachable from the remote host.",+ "DEVICE_LINK_CONTROL_DISABLED": "Control for this device is off; the message was not sent.",+ "DEVICE_LINK_MEDIA_TRANSFER_FAILED": "Attachment transfer failed; the message was not sent. Please try again.",+ "MCP_APPROVAL_AUTO_BLOCKED": "Automatic approval review blocked this tool call. No manual rejection was received.",+ "MCP_APPROVAL_CONFIRMATION_TIMEOUT": "The permission request timed out without a confirmed decision. A timeout does not show whether you clicked a button.",+ "MCP_APPROVAL_CONFIRMATION_UNAVAILABLE": "Permission confirmation could not be completed. No manual rejection was received."}}diff --git a/apps/mobile/src/i18n/locales/ja/session.json b/apps/mobile/src/i18n/locales/ja/session.jsonindex b9239027b0..46285362c4 100644--- a/apps/mobile/src/i18n/locales/ja/session.json+++ b/apps/mobile/src/i18n/locales/ja/session.json@@ -476,6 +476,10 @@"deleteOne": "このメッセージを削除"},"tail": {+ "requestFormatError": "アプリが送信したリクエストの形式に問題があり、返信を完了できませんでした。",+ "replyFailed": "返信を完了できませんでした。原因を確認するには、エラーの詳細をご覧ください。",+ "showErrorDetails": "エラーの詳細を表示",+ "hideErrorDetails": "エラーの詳細を隠す","interrupted": "タスクの実行中にアプリが終了したため、中断されました。","continueTask": "タスクを続ける","retry": "再試行",@@ -512,5 +516,19 @@"restoreFailed": "送信待ちメッセージを復元できませんでした。保存済みの内容は削除されていません。アプリを再起動して再試行してください。","recoveryTarget": "このセッションを復元する際は元のコンピューターを使用してください。後続のメッセージは保存されています。","taskAlreadyCreated": "このセッションはコンピューターに作成済みです。保存されたメッセージは元のセッションで送信を再開します。"+ },+ "remoteError": {+ "REMOTE_DAEMON_CLOSED": "リモート接続が中断されました(daemon がアップグレードまたは再起動中の可能性があります)。ターンが終了しました — 再送信してください。",+ "REMOTE_LOCAL_ATTACHMENT_UNSUPPORTED": "リモートセッションではローカルのファイル/画像の添付にアクセスできません。内容を直接貼り付けてください。",+ "AUTO_REVIEW_UNAVAILABLE": "自動レビューが判断できませんでした(ネットワークまたはサービスの一時的な問題)。レビューが必要な操作はご自身での確認に切り替わりました。中断を減らしたい場合は、このタスクをデフォルト権限に切り替えてください。",+ "AUTO_REVIEW_CONFIRM_UNDELIVERED": "自動レビューを完了できず、確認も完了しませんでした。これはユーザーによる拒否ではありません。",+ "REMOTE_COMPAT_MODE_UNSUPPORTED": "リモート Claude Code セッションはローカル互換プロキシ経由でルーティングできません(内部エラー)。",+ "REMOTE_GATEWAY_ENDPOINT_UNAVAILABLE": "Cindy AI の資格情報がまだ準備できていません(サインイン後に自動発行されます)。しばらくしてから再試行してください。続く場合は 設定 → モデルプロバイダー で Cindy AI の接続状態を確認してください。",+ "REMOTE_LOCAL_ONLY_PROVIDER": "このモデルプロバイダーはローカル専用サービス(Ollama など)で、SSH リモートタスクからはアクセスできません。Cindy AI ゲートウェイに切り替えるか、リモートホストから到達可能なプロバイダーを選んでください。",+ "DEVICE_LINK_CONTROL_DISABLED": "このデバイスの操作はオフです。メッセージは送信されていません。",+ "DEVICE_LINK_MEDIA_TRANSFER_FAILED": "添付ファイルの転送に失敗しました。メッセージは送信されていません。もう一度お試しください。",+ "MCP_APPROVAL_AUTO_BLOCKED": "このツール呼び出しは自動審査でブロックされました。手動で拒否された記録はありません。",+ "MCP_APPROVAL_CONFIRMATION_TIMEOUT": "権限の確認がタイムアウトし、有効な確認結果を受信できませんでした。タイムアウトだけでは、ボタンをクリックしたかどうかは判断できません。",+ "MCP_APPROVAL_CONFIRMATION_UNAVAILABLE": "権限の確認を完了できませんでした。手動で拒否された記録はありません。"}}diff --git a/apps/mobile/src/i18n/locales/ko/session.json b/apps/mobile/src/i18n/locales/ko/session.jsonindex 25831a5ed4..8fc1212dd8 100644--- a/apps/mobile/src/i18n/locales/ko/session.json+++ b/apps/mobile/src/i18n/locales/ko/session.json@@ -472,6 +472,10 @@"deleteOne": "이 메시지 삭제"},"tail": {+ "requestFormatError": "앱이 보낸 요청 형식에 문제가 있어 답변을 완료하지 못했습니다.",+ "replyFailed": "답변을 완료하지 못했습니다. 오류 세부 정보에서 원인을 확인하세요.",+ "showErrorDetails": "오류 세부 정보 보기",+ "hideErrorDetails": "오류 세부 정보 숨기기","interrupted": "작업 실행 도중 앱이 종료되어 중단되었습니다.","continueTask": "작업 계속","retry": "다시 시도",@@ -508,5 +512,19 @@"restoreFailed": "전송 대기 메시지를 복원하지 못했습니다. 저장된 내용은 삭제되지 않았습니다. 앱을 다시 시작하고 재시도하세요.","recoveryTarget": "이 세션을 복원할 때는 기존 컴퓨터를 사용해 주세요. 후속 메시지는 저장되어 있습니다.","taskAlreadyCreated": "이 세션은 컴퓨터에 이미 생성되어 있습니다. 저장된 메시지는 기존 세션에서 전송을 재개합니다."+ },+ "remoteError": {+ "REMOTE_DAEMON_CLOSED": "원격 연결이 중단되었습니다(daemon이 업그레이드 또는 재시작 중일 수 있습니다). 턴이 종료되었습니다 — 다시 전송하세요.",+ "REMOTE_LOCAL_ATTACHMENT_UNSUPPORTED": "원격 세션에서는 로컬 파일/이미지 첨부에 접근할 수 없습니다. 내용을 직접 붙여넣으세요.",+ "AUTO_REVIEW_UNAVAILABLE": "자동 리뷰가 판단을 내리지 못했습니다(네트워크 또는 서비스 일시 장애). 검토가 필요한 작업은 직접 확인하도록 전환되었습니다. 중단을 줄이려면 이 작업을 기본 권한으로 전환하세요.",+ "AUTO_REVIEW_CONFIRM_UNDELIVERED": "자동 리뷰를 끝내지 못했고 확인도 완료되지 않았습니다. 사용자가 거부한 것이 아닙니다.",+ "REMOTE_COMPAT_MODE_UNSUPPORTED": "원격 Claude Code 세션은 로컬 호환 프록시를 통해 라우팅할 수 없습니다(내부 오류).",+ "REMOTE_GATEWAY_ENDPOINT_UNAVAILABLE": "Cindy AI 자격 증명이 아직 준비되지 않았습니다(로그인 후 자동 발급됩니다). 잠시 후 다시 시도해 주세요. 계속되면 설정 → 모델 제공자에서 Cindy AI 연결 상태를 확인하세요.",+ "REMOTE_LOCAL_ONLY_PROVIDER": "이 모델 제공자는 로컬 전용 서비스(예: Ollama)라서 SSH 원격 작업에서 접근할 수 없습니다. Cindy AI 게이트웨이로 전환하거나 원격 호스트에서 접근 가능한 제공자를 선택하세요.",+ "DEVICE_LINK_CONTROL_DISABLED": "이 기기의 제어가 꺼져 있어 메시지가 전송되지 않았습니다.",+ "DEVICE_LINK_MEDIA_TRANSFER_FAILED": "첨부 파일 전송에 실패했습니다. 메시지가 전송되지 않았습니다. 다시 시도하세요.",+ "MCP_APPROVAL_AUTO_BLOCKED": "자동 승인 검토가 이 도구 호출을 차단했습니다. 직접 거부한 기록은 없습니다.",+ "MCP_APPROVAL_CONFIRMATION_TIMEOUT": "권한 확인 시간이 초과되어 유효한 확인 결과를 받지 못했습니다. 시간 초과만으로는 버튼을 클릭했는지 알 수 없습니다.",+ "MCP_APPROVAL_CONFIRMATION_UNAVAILABLE": "권한 확인을 완료하지 못했습니다. 직접 거부한 기록은 없습니다."}}diff --git a/apps/mobile/src/i18n/locales/zh-CN/session.json b/apps/mobile/src/i18n/locales/zh-CN/session.jsonindex c196fe2978..3525e890f4 100644--- a/apps/mobile/src/i18n/locales/zh-CN/session.json+++ b/apps/mobile/src/i18n/locales/zh-CN/session.json@@ -472,6 +472,10 @@"deleteOne": "删除本条消息"},"tail": {+ "requestFormatError": "应用发送的请求格式有误,本次回复未能完成。",+ "replyFailed": "本次回复未能完成。请查看错误详情以了解原因。",+ "showErrorDetails": "查看错误详情",+ "hideErrorDetails": "收起错误详情","interrupted": "任务执行到一半时应用退出,已被中断。","continueTask": "继续任务","retry": "重试",@@ -508,5 +512,19 @@"restoreFailed": "暂时无法恢复待发消息,已保存的内容没有删除。请重启 App 后重试。","recoveryTarget": "恢复这个任务时请保留原来的电脑,后续消息仍保存在手机上。","taskAlreadyCreated": "电脑上已创建这个任务,已保存的消息会在原任务中继续发送。"+ },+ "remoteError": {+ "REMOTE_DAEMON_CLOSED": "远端连接已中断(daemon 可能正在升级或重启)。本轮已结束 — 请重新发送。",+ "REMOTE_LOCAL_ATTACHMENT_UNSUPPORTED": "远端任务无法访问本地文件/图片附件。请直接粘贴内容。",+ "AUTO_REVIEW_UNAVAILABLE": "自动审批暂时无法给出判断(网络或服务波动),需要审批的操作已转由你来确认。想少被打断,可以把任务切到「默认权限」自行掌控。",+ "AUTO_REVIEW_CONFIRM_UNDELIVERED": "自动审批没完成,确认也没有送到或没有被点。这次拒绝不是你点的。",+ "REMOTE_COMPAT_MODE_UNSUPPORTED": "远端 Claude Code 任务无法通过本地兼容 Proxy 路由(内部错误,请反馈)。",+ "REMOTE_GATEWAY_ENDPOINT_UNAVAILABLE": "Cindy AI 凭据尚未就绪(登录后由服务端自动下发)。请稍候重试;若持续出现,请到 设置 → 模型供应商 检查 Cindy AI 连接状态。",+ "REMOTE_LOCAL_ONLY_PROVIDER": "该模型供应商是本机专属服务(如 Ollama),SSH 远端任务无法访问本机地址。请改用 Cindy AI 网关,或选择远端主机可达的模型供应商。",+ "DEVICE_LINK_CONTROL_DISABLED": "已关闭对该设备的控制,消息未发送。",+ "DEVICE_LINK_MEDIA_TRANSFER_FAILED": "附件传输失败,消息未发送。请重试。",+ "MCP_APPROVAL_AUTO_BLOCKED": "这次工具调用被自动审核拦截,未收到你手动拒绝的记录。",+ "MCP_APPROVAL_CONFIRMATION_TIMEOUT": "权限确认超时,未收到有效的确认结果。仅凭超时无法判断你是否点过按钮。",+ "MCP_APPROVAL_CONFIRMATION_UNAVAILABLE": "这次权限确认未完成,未收到你手动拒绝的记录。"}}diff --git a/apps/mobile/src/i18n/locales/zh-TW/session.json b/apps/mobile/src/i18n/locales/zh-TW/session.jsonindex 47b5476910..160aea7da5 100644--- a/apps/mobile/src/i18n/locales/zh-TW/session.json+++ b/apps/mobile/src/i18n/locales/zh-TW/session.json@@ -476,6 +476,10 @@"deleteOne": "刪除本條訊息"},"tail": {+ "requestFormatError": "應用程式送出的請求格式有誤,本次回覆未能完成。",+ "replyFailed": "本次回覆未能完成。請查看錯誤詳情以瞭解原因。",+ "showErrorDetails": "查看錯誤詳情",+ "hideErrorDetails": "收起錯誤詳情","interrupted": "任務執行到一半時應用退出,已被中斷。","continueTask": "繼續任務","retry": "重試",@@ -512,5 +516,19 @@"restoreFailed": "暫時無法恢復待傳訊息,已保存的內容沒有刪除。請重新啟動 App 後重試。","recoveryTarget": "恢復這個任務時請保留原來的電腦,後續訊息仍保存在手機上。","taskAlreadyCreated": "電腦上已建立這個任務,已保存的訊息會在原任務中繼續傳送。"+ },+ "remoteError": {+ "REMOTE_DAEMON_CLOSED": "遠端連線已中斷(daemon 可能正在升級或重啟)。本輪已結束 — 請重新傳送。",+ "REMOTE_LOCAL_ATTACHMENT_UNSUPPORTED": "遠端任務無法訪問本地檔案/圖片附件。請直接貼上內容。",+ "AUTO_REVIEW_UNAVAILABLE": "自動審批暫時無法給出判斷(網路或服務波動),需要審批的操作已轉由你來確認。想少被打斷,可以把任務切到「預設權限」自行掌控。",+ "AUTO_REVIEW_CONFIRM_UNDELIVERED": "自動審批沒完成,確認也沒有送到或沒有被點。這次拒絕不是你點的。",+ "REMOTE_COMPAT_MODE_UNSUPPORTED": "遠端 Claude Code 任務無法透過本地相容 Proxy 路由(內部錯誤,請反饋)。",+ "REMOTE_GATEWAY_ENDPOINT_UNAVAILABLE": "Cindy AI 憑據尚未就緒(登入後由服務端自動下發)。請稍候重試;若持續出現,請到 設定 → 模型供應商 檢查 Cindy AI 連線狀態。",+ "REMOTE_LOCAL_ONLY_PROVIDER": "此模型供應商是本機專屬服務(如 Ollama),SSH 遠端任務無法存取本機位址。請改用 Cindy AI 閘道,或選擇遠端主機可達的模型供應商。",+ "DEVICE_LINK_CONTROL_DISABLED": "已關閉對該裝置的控制,訊息未傳送。",+ "DEVICE_LINK_MEDIA_TRANSFER_FAILED": "附件傳輸失敗,訊息未傳送。請重試。",+ "MCP_APPROVAL_AUTO_BLOCKED": "這次工具呼叫被自動審核攔截,未收到你手動拒絕的紀錄。",+ "MCP_APPROVAL_CONFIRMATION_TIMEOUT": "權限確認逾時,未收到有效的確認結果。僅憑逾時無法判斷你是否點過按鈕。",+ "MCP_APPROVAL_CONFIRMATION_UNAVAILABLE": "這次權限確認未完成,未收到你手動拒絕的紀錄。"}}diff --git a/apps/mobile/src/session/AgentErrorDetails.tsx b/apps/mobile/src/session/AgentErrorDetails.tsxnew file mode 100644index 0000000000..7d526facac--- /dev/null+++ b/apps/mobile/src/session/AgentErrorDetails.tsx@@ -0,0 +1,34 @@+import { useEffect, useState } from 'react';+import { Pressable, StyleSheet, View } from 'react-native';+import { useTranslation } from 'react-i18next';+import { redactSensitiveText } from '@cindy/maker-shared/error-redaction';+import { Text } from '@/components/AppText';+import { useThemedStyles, type ThemeColors } from '@/theme';+import { radius, spacing, typeScale } from '@/theme/tokens';++/** Local disclosure only: never retries a request or changes the persisted error. */+export function AgentErrorDetails({ message }: { message: string }) {+ const { t } = useTranslation();+ const styles = useThemedStyles(makeStyles);+ const [expanded, setExpanded] = useState(false);+ useEffect(() => { setExpanded(false); }, [message]);+ return (+ <View>+ <Pressable+ accessibilityRole="button"+ accessibilityState={{ expanded }}+ onPress={() => setExpanded(value => !value)}+ style={styles.toggle}+ >+ <Text style={styles.label}>{t(expanded ? 'session.tail.hideErrorDetails' : 'session.tail.showErrorDetails')}</Text>+ </Pressable>+ {expanded ? <Text selectable style={styles.detail}>{redactSensitiveText(message)}</Text> : null}+ </View>+ );+}++const makeStyles = (colors: ThemeColors) => StyleSheet.create({+ toggle: { alignSelf: 'flex-start', justifyContent: 'center', minHeight: 44, borderRadius: radius.pill, paddingHorizontal: spacing.sm },+ label: { color: colors.textSecondary, fontSize: typeScale.caption },+ detail: { color: colors.textSecondary, fontSize: typeScale.caption },+});diff --git a/apps/mobile/src/session/InlineQueueSection.tsx b/apps/mobile/src/session/InlineQueueSection.tsxindex 56ddde2573..73c7763b7b 100644--- a/apps/mobile/src/session/InlineQueueSection.tsx+++ b/apps/mobile/src/session/InlineQueueSection.tsx@@ -10,6 +10,7 @@* 停止确认中、队列已暂停(可继续)。它们描述的是队列整体而非某一条消息,没有身份连续性* 问题,留在 footer 最自然。*/+import { AgentErrorDetails } from './AgentErrorDetails';import { useTranslation } from 'react-i18next';import {ActivityIndicator,@@ -25,7 +26,7 @@ import { Pause, Play } from 'lucide-react-native';import { describeAgentAuthError } from '@/device-link/remoteStatus';import type { InputProjection } from '@/session/types';import { inputProjectionErrorI18nKey } from '@/session/inputProjectionError';-import { localizeAgentError } from '@/session/agentErrorI18n';+import { localizeAgentError, localizeUnclassifiedAgentError, requiresAgentErrorConfigurationChange } from '@/session/agentErrorI18n';import {fontWeight,iconSize,@@ -69,6 +70,7 @@ export function InlineQueueSection({const controlsDisabled = busy || !!readOnlyReason;const errorDisabledReason = errorRecoveryReadOnlyReason|| (busy ? t('message.queuePresentation.row.busy') : null);+ const retryable = !requiresAgentErrorConfigurationChange(projection.error ?? '');const retryDisabledReason = errorDisabledReason|| (!projection.errorRetryText ? t('message.queue.noRetryContent') : null);const localizedAgentError = localizeAgentError(@@ -82,24 +84,25 @@ export function InlineQueueSection({? localizedAgentError?? (projectionErrorKey? t(projectionErrorKey)- : (describeAgentAuthError(projection.error) ?? projection.error))+ : (describeAgentAuthError(projection.error) ?? localizeUnclassifiedAgentError(projection.error))): null;return (<View style={styles.container} testID="queue.inline.section">{projection.error ? (<View style={styles.errorBox} testID="queue.inline.error">- {/* 稳定错误 marker 按当前显示端语言翻译;其它错误维持既有 auth 映射或原文。 */}+ {/* 稳定错误 marker 按当前显示端语言翻译;其它错误保留 auth 引导,否则使用本地化摘要。 */}<Text style={styles.errorText}>{projectionError}</Text>+ <AgentErrorDetails message={projection.error} /><View style={styles.errorActions}>- <ActionPill+ {retryable ? <ActionPillbusy={busy}disabled={!!retryDisabledReason}disabledReason={retryDisabledReason}label={t('message.queue.retrySend')}onPress={onRetryError}testID="queue.inline.retryButton"- />+ /> : null}<ActionPillbusy={busy}disabled={!!errorDisabledReason}@@ -109,7 +112,7 @@ export function InlineQueueSection({testID="queue.inline.clearErrorButton"/></View>- {retryDisabledReason ? (+ {retryable && retryDisabledReason ? (<Text style={styles.disabledHint} testID="queue.inline.errorDisabledReason">{retryDisabledReason}</Text>diff --git a/apps/mobile/src/session/MessageRenderer.tsx b/apps/mobile/src/session/MessageRenderer.tsxindex 78162f2876..3425c5e5de 100644--- a/apps/mobile/src/session/MessageRenderer.tsx+++ b/apps/mobile/src/session/MessageRenderer.tsx@@ -1,3 +1,4 @@+import { AgentErrorDetails } from './AgentErrorDetails';import { FileTypeIcon } from '@/components/FileTypeIcon';import { CompanionMessageActions } from './CompanionMessageActions';import { useMessageHistoryActive, useMessageHistoryPositioning } from './messageHistoryActivity';@@ -3119,7 +3120,7 @@ function MessageBubble({));const bubbleBody = messageQuotes.length > 0? joinChatQuoteTextSegments(quoteSegments)- : item.message.body;+ : item.message.errorSummaryKey ? t(item.message.errorSummaryKey) : item.message.body;const sentInlineTokens = useMemo(() => (item.message.kind === 'user'? buildVisibleSentInlineTokens(@@ -3648,6 +3649,7 @@ function MessageBubble({) : null}{attachmentStripNode}{hasBubbleContent || (!attachmentStripNode && messageQuotes.length === 0) ? bubble : null}+ {item.message.rawError ? <AgentErrorDetails key={item.message.key} message={item.message.rawError} /> : null}{item.message.kind === 'assistant' && item.message.modelMismatch ? (// 模型降级提示(对齐桌面 AssistantMessage):所选模型本轮被上游静默替换,// 常显在气泡下方,icon 用 warning 橙、文字保持 tertiary 灰阶。diff --git a/apps/mobile/src/session/SessionTailBanner.tsx b/apps/mobile/src/session/SessionTailBanner.tsxindex a10437a3d9..d02858b589 100644--- a/apps/mobile/src/session/SessionTailBanner.tsx+++ b/apps/mobile/src/session/SessionTailBanner.tsx@@ -9,6 +9,7 @@* 消息流不渲染,用户只看到任务继续跑);* - 「忽略」→ error-tail 持久化 dismiss / interrupted 写 ack,不再提示。*/+import { AgentErrorDetails } from './AgentErrorDetails';import { Pressable, StyleSheet } from 'react-native';import { useTranslation } from 'react-i18next';import { Text } from '@/components/AppText';@@ -35,7 +36,7 @@ export function SessionTailBanner({ state, busy, readOnly, onContinue, onDismissconst { t } = useTranslation();const isInterrupted = state.kind === 'interrupted' || state.continueKind === 'interrupted';const text = state.kind === 'error-tail' && state.continueKind === 'error'- ? state.text+ ? state.summaryKey ? t(state.summaryKey) : state.text: t('session.tail.interrupted');const showContinue = state.kind === 'interrupted' || state.retryable;return (@@ -46,6 +47,7 @@ export function SessionTailBanner({ state, busy, readOnly, onContinue, onDismiss>{text}</Text>+ {state.kind === 'error-tail' && state.rawError && !isInterrupted ? <AgentErrorDetails message={state.rawError} /> : null}{readOnly ? null : (<View style={styles.actions}>{showContinue ? (diff --git a/apps/mobile/src/session/agentErrorI18n.ts b/apps/mobile/src/session/agentErrorI18n.tsindex f9361cf384..454a1064d4 100644--- a/apps/mobile/src/session/agentErrorI18n.ts+++ b/apps/mobile/src/session/agentErrorI18n.ts@@ -1,3 +1,4 @@+import { isResponsesLiteParallelToolCallsError, parseAgentErrorCode } from '@cindy/maker-shared/error-redaction';import { i18n } from '@/i18n';export type MobileToolLoopErrorKind = 'consecutive' | 'pingpong' | 'rotation' | 'contract';@@ -56,3 +57,26 @@ export function localizeAgentError(if (!toolLoop) return i18n.t('session.tail.toolUseLoopDetected');return i18n.t(TOOL_LOOP_I18N_KEYS[toolLoop.kind], { count: toolLoop.count });}++/** Unknown provider messages stay in diagnostic details, never in the localized summary. */+export function unclassifiedAgentErrorI18nKey(message: string): string {+ const parsed = parseAgentErrorCode(message);+ const key = parsed ? `session.remoteError.${parsed.code}` : null;+ if (key && i18n.exists(key)) return key;+ return isResponsesLiteParallelToolCallsError(message)+ ? 'session.tail.requestFormatError'+ : 'session.tail.replyFailed';+}++export function localizeUnclassifiedAgentError(message: string): string {+ return i18n.t(unclassifiedAgentErrorI18nKey(message));+}++/** Resending unchanged content cannot fix these explicit configuration failures. */+export function requiresAgentErrorConfigurationChange(message: string): boolean {+ const code = parseAgentErrorCode(message)?.code;+ return code === 'REMOTE_LOCAL_ATTACHMENT_UNSUPPORTED'+ || code === 'REMOTE_COMPAT_MODE_UNSUPPORTED'+ || code === 'REMOTE_LOCAL_ONLY_PROVIDER'+ || code === 'DEVICE_LINK_CONTROL_DISABLED';+}diff --git a/apps/mobile/src/session/messageNormalize.ts b/apps/mobile/src/session/messageNormalize.tsindex 7bb2a40143..ff60ec8296 100644--- a/apps/mobile/src/session/messageNormalize.ts+++ b/apps/mobile/src/session/messageNormalize.ts@@ -53,6 +53,8 @@ import {} from '@/session/remoteMoney';import {localizeAgentError,+ localizeUnclassifiedAgentError,+ unclassifiedAgentErrorI18nKey,parseMobileToolLoopErrorDetails,} from '@/session/agentErrorI18n';import type { MobileToolInputProjection } from '@/session/messageToolPayloadProjection';@@ -73,6 +75,8 @@ export interface NormalizedRemoteMessage {role: RemoteMessageRole;label: string;body: string;+ rawError?: string;+ errorSummaryKey?: string;/** user 消息正文包含产品引用编码;驱动跨端 marker/legacy 解析。 */quotesEncoded?: boolean;/** user 长文本粘贴原子的精确 wire ranges;正文仍保留完整 Agent payload。 */@@ -320,13 +324,13 @@ export function normalizeRemoteMessages(// turn 失败终态的持久化行(desktop main 落库):content = { message, reason? },// 提取 message 文案按 system 样式展示 —— 不加分支会 fall through 到通用兜底,// body 变成整段生 JSON。稳定的 tool-loop reason/toolLoop 走本地化,agent 未鉴权错误- // 换成带引导的中文提示(describeAgentAuthError),其余未知错误保留原始 message。+ // 换成本地化引导(describeAgentAuthError),其余未知错误使用本地化摘要,原文留给折叠详情。if (message.role === 'error') {const c = parseMaybeJsonObject(message.content);const rawText = typeof c?.message === 'string' ? c.message : contentToPreview(message.content);const toolLoop = parseMobileToolLoopErrorDetails(c?.toolLoop);- const errText =- describeAgentAuthError(rawText) ?? localizeAgentError(c?.reason, toolLoop) ?? rawText;+ const guidance = describeAgentAuthError(rawText) ?? localizeAgentError(c?.reason, toolLoop);+ const errText = guidance ?? localizeUnclassifiedAgentError(rawText);result.push({key: messageNormalizeKey(message),source: message,@@ -334,6 +338,8 @@ export function normalizeRemoteMessages(role: message.role,label: 'error',body: errText,+ rawError: rawText,+ ...(!guidance ? { errorSummaryKey: unclassifiedAgentErrorI18nKey(rawText) } : {}),align: 'agent',createdAt: message.createdAt,});diff --git a/apps/mobile/src/session/sessionTailBannerModel.ts b/apps/mobile/src/session/sessionTailBannerModel.tsindex 0889744e0f..5957f99ce1 100644--- a/apps/mobile/src/session/sessionTailBannerModel.ts+++ b/apps/mobile/src/session/sessionTailBannerModel.ts@@ -31,6 +31,9 @@ import { i18n } from '@/i18n';import type { InputProjection, QueuedRemoteMessage, RemoteMessage, RemoteSession } from '@/session/types';import {localizeAgentError,+ requiresAgentErrorConfigurationChange,+ localizeUnclassifiedAgentError,+ unclassifiedAgentErrorI18nKey,parseMobileToolLoopErrorDetails,type MobileToolLoopErrorDetails,} from '@/session/agentErrorI18n';@@ -39,8 +42,10 @@ export interface SessionTailErrorBanner {kind: 'error-tail';/** 错误行 clientId:忽略(dismiss)与本地隐藏态都按它归属。 */clientId: string;- /** 展示文案(agent 未鉴权与工具循环错误会本地化,其余保持原文)。 */+ /** 本地化展示文案;未知错误的技术原文放入 rawError。 */text: string;+ rawError?: string;+ summaryKey?: string;/** 主按钮语义:中断标记行 →「继续任务」;普通失败行 →「重试」。 */continueKind: 'interrupted' | 'error';/**@@ -104,9 +109,11 @@ export function resolveSessionTailBanner(input: ResolveSessionTailBannerInput):return {kind: 'error-tail',clientId: tail.clientId,- text: nonRetryableGuidance ?? agentErrorGuidance ?? tail.text,+ text: nonRetryableGuidance ?? agentErrorGuidance ?? localizeUnclassifiedAgentError(tail.text),+ rawError: tail.text,+ ...(!nonRetryableGuidance && !agentErrorGuidance ? { summaryKey: unclassifiedAgentErrorI18nKey(tail.text) } : {}),continueKind: tail.reason === APP_EXIT_INTERRUPTED_REASON ? 'interrupted' : 'error',- retryable: nonRetryableGuidance === null,+ retryable: nonRetryableGuidance === null && !requiresAgentErrorConfigurationChange(tail.text),};}// 历史中断行优先;无 error-tail 才轮到 session 双时间戳判定(对齐桌面互斥渲染)。diff --git a/docs/assets/localized-reply-errors/desktop-details-dark.png b/docs/assets/localized-reply-errors/desktop-details-dark.pngnew file mode 100644index 0000000000..dbf664590cBinary files /dev/null and b/docs/assets/localized-reply-errors/desktop-details-dark.png differdiff --git a/docs/assets/localized-reply-errors/desktop-light.png b/docs/assets/localized-reply-errors/desktop-light.pngnew file mode 100644index 0000000000..e6cb24588dBinary files /dev/null and b/docs/assets/localized-reply-errors/desktop-light.png differdiff --git a/docs/design-rules/design-inventory.md b/docs/design-rules/design-inventory.mdindex a66766287a..aab282c6c7 100644--- a/docs/design-rules/design-inventory.md+++ b/docs/design-rules/design-inventory.md@@ -55,7 +55,7 @@| `mobile.auth` | mobile | 登录与添加账号 | app/(auth)/login.tsx / app/add-account.tsx | AccountSwitcherSheet, AdaptiveWindow, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, IncomingShareBridge, LoginCaptchaWebView, LoginNativeButton, LoginNativeButton.ios, LoginSkinControls, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, StartupSplashOverlay, SystemNavigationBack, ThemeProvider, _layout, add-account, gestureHandler, login, peerFileTransport, useLocale | apps/mobile/app/(auth)/login.tsx, apps/mobile/app/_layout.tsx, apps/mobile/app/add-account.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/LoginCaptchaWebView.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/LoginNativeButton.ios.tsx, apps/mobile/src/components/LoginNativeButton.tsx, apps/mobile/src/components/LoginSkinControls.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SystemNavigationBack.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 211 | 80 || `mobile.automations` | mobile | 自动化 | app/automations/[deviceId].tsx | AdaptiveWindow, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [deviceId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/automations/[deviceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 204 | 74 || `mobile.chat.new` | mobile | 新建任务 | app/sessions/new.tsx | AdaptiveWindow, AndroidUpdateSheet, AnnotationBurnInWebView, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerAttachmentTray, ComposerFrame, ComposerFrame.ios, ComposerKeyboardAvoidingView, ComposerNativeRow, ComposerNativeRow.ios, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, ContextSheetGoalView, ContextSheetGoalView.ios, ContextSheetMediaViews, DeviceLinkContext, FileTypeIcon, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, ImageLightbox, IncomingShareBridge, MobileAgentMark, MobileAgentSwitcher, MobileChoicePickerList, MobileComposerInputRow, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileModelPickerList, MobileModelPickerList.ios, MobileOutboxBridge, MobilePermissionPickerList, MobilePermissionPickerList.ios, MobilePrimitives, MobileProviderMark, MobileVendorIcon, ModelOptionsSheetView, ModelOptionsSheetView.ios, ModelPickerNativeHeader, ModelPickerNativeHeader.ios, ModelPickerSheet, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePermissionSheet, NativePermissionSheet.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, NewTaskSelectionSheet, NewTaskSelectionSheet.ios, PaperPlaneIcon, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PlanModeChip, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, SimpleStackHeader, SlowSendNotice, StartupSplashOverlay, ThemeProvider, UnifiedModelPickerSheet, UnifiedModelPickerView, UnifiedModelPickerView.ios, VoiceRecordingPill, _layout, gestureHandler, new, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/sessions/new.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/FileTypeIcon.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/PaperPlaneIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/AnnotationBurnInWebView.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerAttachmentTray.tsx, apps/mobile/src/session/ComposerFrame.ios.tsx, apps/mobile/src/session/ComposerFrame.tsx, apps/mobile/src/session/ComposerKeyboardAvoidingView.tsx, apps/mobile/src/session/ComposerNativeRow.ios.tsx, apps/mobile/src/session/ComposerNativeRow.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ContextSheetGoalView.ios.tsx, apps/mobile/src/session/ContextSheetGoalView.tsx, apps/mobile/src/session/ContextSheetMediaViews.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileAgentSwitcher.tsx, apps/mobile/src/session/MobileChoicePickerList.tsx, apps/mobile/src/session/MobileComposerInputRow.tsx, apps/mobile/src/session/MobileModelPickerList.ios.tsx, apps/mobile/src/session/MobileModelPickerList.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/MobilePermissionPickerList.ios.tsx, apps/mobile/src/session/MobilePermissionPickerList.tsx, apps/mobile/src/session/MobileProviderMark.tsx, apps/mobile/src/session/ModelOptionsSheetView.ios.tsx, apps/mobile/src/session/ModelOptionsSheetView.tsx, apps/mobile/src/session/ModelPickerNativeHeader.ios.tsx, apps/mobile/src/session/ModelPickerNativeHeader.tsx, apps/mobile/src/session/ModelPickerSheet.tsx, apps/mobile/src/session/NativePermissionSheet.ios.tsx, apps/mobile/src/session/NativePermissionSheet.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/NewTaskSelectionSheet.ios.tsx, apps/mobile/src/session/NewTaskSelectionSheet.tsx, apps/mobile/src/session/PlanModeChip.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SlowSendNotice.tsx, apps/mobile/src/session/UnifiedModelPickerSheet.tsx, apps/mobile/src/session/UnifiedModelPickerView.ios.tsx, apps/mobile/src/session/UnifiedModelPickerView.tsx, apps/mobile/src/session/VoiceRecordingPill.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 236 | 113 |-| `mobile.chat.session` | mobile | 任务内容与输入 | app/sessions/[sessionId].tsx | AccountSwitcherSheet, AdaptiveWindow, AndroidUpdateSheet, AnnotationBurnInWebView, AppText, AuthContext, AuthorizationMessageCard, AutomationTimerIcon, BlurBackdrop, CenteredScreen, ChatFileChipMenuSheet, CompanionAutomationNativeView, CompanionAutomationNativeView.ios, CompanionAutomationSheet, CompanionChoice, CompanionCreateNativeView, CompanionCreateNativeView.ios, CompanionHeader, CompanionMessageActions, CompanionMessageCard, CompanionModelChain, CompanionNativeContent.ios, CompanionNavigationDrawer, CompanionPortraitPicker, CompanionProfileArtifacts, CompanionProfileNativeView, CompanionProfileNativeView.ios, CompanionProfileSheet, CompanionSettingsRow, CompanionSettingsRow.ios, CompanionSheet, CompanionSheet.ios, CompanionWorkingStatus, ComposerAttachmentTray, ComposerExpandButton, ComposerExpandButton.ios, ComposerFrame, ComposerFrame.ios, ComposerKeyboardAvoidingView, ComposerNativeInput, ComposerNativeInput.ios, ComposerNativeRow, ComposerNativeRow.ios, ComposerNativeSection, ComposerNativeSection.ios, ComposerRichInput, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, ContextSheetGoalView, ContextSheetGoalView.ios, ContextSheetMediaViews, ConversationSearchFilterSheet, ConversationShareSvg, ConversationShareWebView, DeviceLinkContext, FailedScheduleNotice, FileTypeIcon, FoldTouchpad, HomeChromeDrawer, HomeChromeFrost, HomeEntryProvider, HomeGlassMenuPanel, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeListVisuals, HomeModeSwitch, HomeNativeStackHeader, HomeNewTaskButton, HomeProjectMachineLabel, HomeSearchBar, HomeSurface, ImageLightbox, IncomingShareBridge, InlineQueueSection, InlineQuoteChip, InlineReferenceChip, InteractionPanel, LoginNativeButton, LoginNativeButton.ios, MarkdownBlockContent, MessageActionSheet, MessageRenderer, MobileAgentMark, MobileAgentSwitcher, MobileBoundaryNotice, MobileComposerInputRow, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileModelPickerList, MobileModelPickerList.ios, MobileOutboxBridge, MobilePermissionPickerList, MobilePermissionPickerList.ios, MobilePrimitives, MobileProviderMark, MobileVendorIcon, ModalContentArea, ModelOptionsSheetView, ModelOptionsSheetView.ios, ModelPickerNativeHeader, ModelPickerNativeHeader.ios, ModelPickerSheet, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePermissionSheet, NativePermissionSheet.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, PaperPlaneIcon, PendingSendBubble, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PlanModeChip, PluginInvocationHeader, PromptRecommendation, PushNotificationsBridge, QuietSyncIndicator, QuoteCapsule, RecentMessageHistories, RemoteAccessGuide, RemoteCompanionAvatar, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, RemoteTaskSuggestions, RenameSessionModal, ResidentHomeList, RewindPreviewPanel, SentInlineAtomBody, SessionActionSheet, SessionDetailsNative, SessionDetailsNative.ios, SessionHeaderNativeControls, SessionHeaderNativeControls.ios, SessionListDrawer, SessionMenuSheet, SessionOptionsExpoSheet, SessionResourceCards, SessionSearchNative, SessionSearchNative.ios, SessionTailBanner, SessionUsageSummary, ShareImageNativeButton, ShareImageNativeButton.ios, ShareMessageCheckbox, ShareSelectAllButton, ShareSelectionBar, SharedTaskEndedState, SharedTaskScreen, SheetModal, SheetSurface, SimpleStackHeader, SlowSendNotice, StartupSplashOverlay, StreamingStatusText, SwipeableSessionRow, SwipeableSessionRow.ios, SystemNavigationBack, TaskTags, TaskTagsSheet, TeammateGenerationLabel, TeammateList, TeammatePicker, ThemeProvider, UnifiedModelPickerSheet, UnifiedModelPickerView, UnifiedModelPickerView.ios, VoiceRecordingPill, [sessionId], _layout, gestureHandler, mathWebView, mediaPlayerWebView, mermaidWebView, peerFileTransport, useLocale, useSharedTaskConfirmation | apps/mobile/app/_layout.tsx, apps/mobile/app/sessions/[sessionId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/FileTypeIcon.tsx, apps/mobile/src/components/LoginNativeButton.ios.tsx, apps/mobile/src/components/LoginNativeButton.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/PaperPlaneIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteAccessGuide.tsx, apps/mobile/src/components/RemoteCompanionAvatar.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/ModalContentArea.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/chrome/SystemNavigationBack.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/AnnotationBurnInWebView.tsx, apps/mobile/src/session/AuthorizationMessageCard.tsx, apps/mobile/src/session/AutomationTimerIcon.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ChatFileChipMenuSheet.tsx, apps/mobile/src/session/CompanionAutomationNativeView.ios.tsx, apps/mobile/src/session/CompanionAutomationNativeView.tsx, apps/mobile/src/session/CompanionAutomationSheet.tsx, apps/mobile/src/session/CompanionChoice.tsx, apps/mobile/src/session/CompanionCreateNativeView.ios.tsx, apps/mobile/src/session/CompanionCreateNativeView.tsx, apps/mobile/src/session/CompanionHeader.tsx, apps/mobile/src/session/CompanionMessageActions.tsx, apps/mobile/src/session/CompanionMessageCard.tsx, apps/mobile/src/session/CompanionModelChain.tsx, apps/mobile/src/session/CompanionNativeContent.ios.tsx, apps/mobile/src/session/CompanionNavigationDrawer.tsx, apps/mobile/src/session/CompanionPortraitPicker.tsx, apps/mobile/src/session/CompanionProfileArtifacts.tsx, apps/mobile/src/session/CompanionProfileNativeView.ios.tsx, apps/mobile/src/session/CompanionProfileNativeView.tsx, apps/mobile/src/session/CompanionProfileSheet.tsx, apps/mobile/src/session/CompanionSettingsRow.ios.tsx, apps/mobile/src/session/CompanionSettingsRow.tsx, apps/mobile/src/session/CompanionSheet.ios.tsx, apps/mobile/src/session/CompanionSheet.tsx, apps/mobile/src/session/CompanionWorkingStatus.tsx, apps/mobile/src/session/ComposerAttachmentTray.tsx, apps/mobile/src/session/ComposerExpandButton.ios.tsx, apps/mobile/src/session/ComposerExpandButton.tsx, apps/mobile/src/session/ComposerFrame.ios.tsx, apps/mobile/src/session/ComposerFrame.tsx, apps/mobile/src/session/ComposerKeyboardAvoidingView.tsx, apps/mobile/src/session/ComposerNativeInput.ios.tsx, apps/mobile/src/session/ComposerNativeInput.tsx, apps/mobile/src/session/ComposerNativeRow.ios.tsx, apps/mobile/src/session/ComposerNativeRow.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerRichInput.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ContextSheetGoalView.ios.tsx, apps/mobile/src/session/ContextSheetGoalView.tsx, apps/mobile/src/session/ContextSheetMediaViews.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/ConversationShareSvg.tsx, apps/mobile/src/session/ConversationShareWebView.tsx, apps/mobile/src/session/FailedScheduleNotice.tsx, apps/mobile/src/session/HomeChromeDrawer.tsx, apps/mobile/src/session/HomeChromeFrost.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HomeListVisuals.tsx, apps/mobile/src/session/HomeModeSwitch.tsx, apps/mobile/src/session/HomeNewTaskButton.tsx, apps/mobile/src/session/HomeProjectMachineLabel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/HomeSurface.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/InlineQueueSection.tsx, apps/mobile/src/session/InlineQuoteChip.tsx, apps/mobile/src/session/InlineReferenceChip.tsx, apps/mobile/src/session/InteractionPanel.tsx, apps/mobile/src/session/MarkdownBlockContent.tsx, apps/mobile/src/session/MessageActionSheet.tsx, apps/mobile/src/session/MessageRenderer.tsx, apps/mobile/src/session/MobileAgentSwitcher.tsx, apps/mobile/src/session/MobileBoundaryNotice.tsx, apps/mobile/src/session/MobileComposerInputRow.tsx, apps/mobile/src/session/MobileModelPickerList.ios.tsx, apps/mobile/src/session/MobileModelPickerList.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/MobilePermissionPickerList.ios.tsx, apps/mobile/src/session/MobilePermissionPickerList.tsx, apps/mobile/src/session/MobileProviderMark.tsx, apps/mobile/src/session/ModelOptionsSheetView.ios.tsx, apps/mobile/src/session/ModelOptionsSheetView.tsx, apps/mobile/src/session/ModelPickerNativeHeader.ios.tsx, apps/mobile/src/session/ModelPickerNativeHeader.tsx, apps/mobile/src/session/ModelPickerSheet.tsx, apps/mobile/src/session/NativePermissionSheet.ios.tsx, apps/mobile/src/session/NativePermissionSheet.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/PendingSendBubble.tsx, apps/mobile/src/session/PlanModeChip.tsx, apps/mobile/src/session/PluginInvocationHeader.tsx, apps/mobile/src/session/PromptRecommendation.tsx, apps/mobile/src/session/QuoteCapsule.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/RemoteTaskSuggestions.tsx, apps/mobile/src/session/RenameSessionModal.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/RewindPreviewPanel.tsx, apps/mobile/src/session/SentInlineAtomBody.tsx, apps/mobile/src/session/SessionActionSheet.tsx, apps/mobile/src/session/SessionDetailsNative.ios.tsx, apps/mobile/src/session/SessionDetailsNative.tsx, apps/mobile/src/session/SessionHeaderNativeControls.ios.tsx, apps/mobile/src/session/SessionHeaderNativeControls.tsx, apps/mobile/src/session/SessionListDrawer.tsx, apps/mobile/src/session/SessionMenuSheet.tsx, apps/mobile/src/session/SessionOptionsExpoSheet.tsx, apps/mobile/src/session/SessionResourceCards.tsx, apps/mobile/src/session/SessionSearchNative.ios.tsx, apps/mobile/src/session/SessionSearchNative.tsx, apps/mobile/src/session/SessionTailBanner.tsx, apps/mobile/src/session/SessionUsageSummary.tsx, apps/mobile/src/session/ShareImageNativeButton.ios.tsx, apps/mobile/src/session/ShareImageNativeButton.tsx, apps/mobile/src/session/ShareMessageCheckbox.tsx, apps/mobile/src/session/ShareSelectAllButton.tsx, apps/mobile/src/session/ShareSelectionBar.tsx, apps/mobile/src/session/SharedTaskEndedState.tsx, apps/mobile/src/session/SharedTaskScreen.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SlowSendNotice.tsx, apps/mobile/src/session/StreamingStatusText.tsx, apps/mobile/src/session/SwipeableSessionRow.ios.tsx, apps/mobile/src/session/SwipeableSessionRow.tsx, apps/mobile/src/session/TaskTags.tsx, apps/mobile/src/session/TaskTagsSheet.tsx, apps/mobile/src/session/TeammateGenerationLabel.tsx, apps/mobile/src/session/TeammateList.tsx, apps/mobile/src/session/TeammatePicker.tsx, apps/mobile/src/session/UnifiedModelPickerSheet.tsx, apps/mobile/src/session/UnifiedModelPickerView.ios.tsx, apps/mobile/src/session/UnifiedModelPickerView.tsx, apps/mobile/src/session/VoiceRecordingPill.tsx, apps/mobile/src/session/composerRichInputHtml.ts, apps/mobile/src/session/conversationShareWebViewHtml.ts, apps/mobile/src/session/mathWebView.tsx, apps/mobile/src/session/mathWebViewHtml.ts, apps/mobile/src/session/mediaPlayerWebView.tsx, apps/mobile/src/session/mediaPlayerWebViewHtml.ts, apps/mobile/src/session/mermaidWebView.tsx, apps/mobile/src/session/mermaidWebViewHtml.ts, apps/mobile/src/session/selectableMarkdownHtml.ts, apps/mobile/src/session/useSharedTaskConfirmation.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 7 | 237 | 299 |+| `mobile.chat.session` | mobile | 任务内容与输入 | app/sessions/[sessionId].tsx | AccountSwitcherSheet, AdaptiveWindow, AgentErrorDetails, AndroidUpdateSheet, AnnotationBurnInWebView, AppText, AuthContext, AuthorizationMessageCard, AutomationTimerIcon, BlurBackdrop, CenteredScreen, ChatFileChipMenuSheet, CompanionAutomationNativeView, CompanionAutomationNativeView.ios, CompanionAutomationSheet, CompanionChoice, CompanionCreateNativeView, CompanionCreateNativeView.ios, CompanionHeader, CompanionMessageActions, CompanionMessageCard, CompanionModelChain, CompanionNativeContent.ios, CompanionNavigationDrawer, CompanionPortraitPicker, CompanionProfileArtifacts, CompanionProfileNativeView, CompanionProfileNativeView.ios, CompanionProfileSheet, CompanionSettingsRow, CompanionSettingsRow.ios, CompanionSheet, CompanionSheet.ios, CompanionWorkingStatus, ComposerAttachmentTray, ComposerExpandButton, ComposerExpandButton.ios, ComposerFrame, ComposerFrame.ios, ComposerKeyboardAvoidingView, ComposerNativeInput, ComposerNativeInput.ios, ComposerNativeRow, ComposerNativeRow.ios, ComposerNativeSection, ComposerNativeSection.ios, ComposerRichInput, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, ContextSheetGoalView, ContextSheetGoalView.ios, ContextSheetMediaViews, ConversationSearchFilterSheet, ConversationShareSvg, ConversationShareWebView, DeviceLinkContext, FailedScheduleNotice, FileTypeIcon, FoldTouchpad, HomeChromeDrawer, HomeChromeFrost, HomeEntryProvider, HomeGlassMenuPanel, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeListVisuals, HomeModeSwitch, HomeNativeStackHeader, HomeNewTaskButton, HomeProjectMachineLabel, HomeSearchBar, HomeSurface, ImageLightbox, IncomingShareBridge, InlineQueueSection, InlineQuoteChip, InlineReferenceChip, InteractionPanel, LoginNativeButton, LoginNativeButton.ios, MarkdownBlockContent, MessageActionSheet, MessageRenderer, MobileAgentMark, MobileAgentSwitcher, MobileBoundaryNotice, MobileComposerInputRow, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileModelPickerList, MobileModelPickerList.ios, MobileOutboxBridge, MobilePermissionPickerList, MobilePermissionPickerList.ios, MobilePrimitives, MobileProviderMark, MobileVendorIcon, ModalContentArea, ModelOptionsSheetView, ModelOptionsSheetView.ios, ModelPickerNativeHeader, ModelPickerNativeHeader.ios, ModelPickerSheet, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePermissionSheet, NativePermissionSheet.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, PaperPlaneIcon, PendingSendBubble, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PlanModeChip, PluginInvocationHeader, PromptRecommendation, PushNotificationsBridge, QuietSyncIndicator, QuoteCapsule, RecentMessageHistories, RemoteAccessGuide, RemoteCompanionAvatar, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, RemoteTaskSuggestions, RenameSessionModal, ResidentHomeList, RewindPreviewPanel, SentInlineAtomBody, SessionActionSheet, SessionDetailsNative, SessionDetailsNative.ios, SessionHeaderNativeControls, SessionHeaderNativeControls.ios, SessionListDrawer, SessionMenuSheet, SessionOptionsExpoSheet, SessionResourceCards, SessionSearchNative, SessionSearchNative.ios, SessionTailBanner, SessionUsageSummary, ShareImageNativeButton, ShareImageNativeButton.ios, ShareMessageCheckbox, ShareSelectAllButton, ShareSelectionBar, SharedTaskEndedState, SharedTaskScreen, SheetModal, SheetSurface, SimpleStackHeader, SlowSendNotice, StartupSplashOverlay, StreamingStatusText, SwipeableSessionRow, SwipeableSessionRow.ios, SystemNavigationBack, TaskTags, TaskTagsSheet, TeammateGenerationLabel, TeammateList, TeammatePicker, ThemeProvider, UnifiedModelPickerSheet, UnifiedModelPickerView, UnifiedModelPickerView.ios, VoiceRecordingPill, [sessionId], _layout, gestureHandler, mathWebView, mediaPlayerWebView, mermaidWebView, peerFileTransport, useLocale, useSharedTaskConfirmation | apps/mobile/app/_layout.tsx, apps/mobile/app/sessions/[sessionId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/FileTypeIcon.tsx, apps/mobile/src/components/LoginNativeButton.ios.tsx, apps/mobile/src/components/LoginNativeButton.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/PaperPlaneIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteAccessGuide.tsx, apps/mobile/src/components/RemoteCompanionAvatar.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/ModalContentArea.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/chrome/SystemNavigationBack.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/AgentErrorDetails.tsx, apps/mobile/src/session/AnnotationBurnInWebView.tsx, apps/mobile/src/session/AuthorizationMessageCard.tsx, apps/mobile/src/session/AutomationTimerIcon.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ChatFileChipMenuSheet.tsx, apps/mobile/src/session/CompanionAutomationNativeView.ios.tsx, apps/mobile/src/session/CompanionAutomationNativeView.tsx, apps/mobile/src/session/CompanionAutomationSheet.tsx, apps/mobile/src/session/CompanionChoice.tsx, apps/mobile/src/session/CompanionCreateNativeView.ios.tsx, apps/mobile/src/session/CompanionCreateNativeView.tsx, apps/mobile/src/session/CompanionHeader.tsx, apps/mobile/src/session/CompanionMessageActions.tsx, apps/mobile/src/session/CompanionMessageCard.tsx, apps/mobile/src/session/CompanionModelChain.tsx, apps/mobile/src/session/CompanionNativeContent.ios.tsx, apps/mobile/src/session/CompanionNavigationDrawer.tsx, apps/mobile/src/session/CompanionPortraitPicker.tsx, apps/mobile/src/session/CompanionProfileArtifacts.tsx, apps/mobile/src/session/CompanionProfileNativeView.ios.tsx, apps/mobile/src/session/CompanionProfileNativeView.tsx, apps/mobile/src/session/CompanionProfileSheet.tsx, apps/mobile/src/session/CompanionSettingsRow.ios.tsx, apps/mobile/src/session/CompanionSettingsRow.tsx, apps/mobile/src/session/CompanionSheet.ios.tsx, apps/mobile/src/session/CompanionSheet.tsx, apps/mobile/src/session/CompanionWorkingStatus.tsx, apps/mobile/src/session/ComposerAttachmentTray.tsx, apps/mobile/src/session/ComposerExpandButton.ios.tsx, apps/mobile/src/session/ComposerExpandButton.tsx, apps/mobile/src/session/ComposerFrame.ios.tsx, apps/mobile/src/session/ComposerFrame.tsx, apps/mobile/src/session/ComposerKeyboardAvoidingView.tsx, apps/mobile/src/session/ComposerNativeInput.ios.tsx, apps/mobile/src/session/ComposerNativeInput.tsx, apps/mobile/src/session/ComposerNativeRow.ios.tsx, apps/mobile/src/session/ComposerNativeRow.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerRichInput.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ContextSheetGoalView.ios.tsx, apps/mobile/src/session/ContextSheetGoalView.tsx, apps/mobile/src/session/ContextSheetMediaViews.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/ConversationShareSvg.tsx, apps/mobile/src/session/ConversationShareWebView.tsx, apps/mobile/src/session/FailedScheduleNotice.tsx, apps/mobile/src/session/HomeChromeDrawer.tsx, apps/mobile/src/session/HomeChromeFrost.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HomeListVisuals.tsx, apps/mobile/src/session/HomeModeSwitch.tsx, apps/mobile/src/session/HomeNewTaskButton.tsx, apps/mobile/src/session/HomeProjectMachineLabel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/HomeSurface.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/InlineQueueSection.tsx, apps/mobile/src/session/InlineQuoteChip.tsx, apps/mobile/src/session/InlineReferenceChip.tsx, apps/mobile/src/session/InteractionPanel.tsx, apps/mobile/src/session/MarkdownBlockContent.tsx, apps/mobile/src/session/MessageActionSheet.tsx, apps/mobile/src/session/MessageRenderer.tsx, apps/mobile/src/session/MobileAgentSwitcher.tsx, apps/mobile/src/session/MobileBoundaryNotice.tsx, apps/mobile/src/session/MobileComposerInputRow.tsx, apps/mobile/src/session/MobileModelPickerList.ios.tsx, apps/mobile/src/session/MobileModelPickerList.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/MobilePermissionPickerList.ios.tsx, apps/mobile/src/session/MobilePermissionPickerList.tsx, apps/mobile/src/session/MobileProviderMark.tsx, apps/mobile/src/session/ModelOptionsSheetView.ios.tsx, apps/mobile/src/session/ModelOptionsSheetView.tsx, apps/mobile/src/session/ModelPickerNativeHeader.ios.tsx, apps/mobile/src/session/ModelPickerNativeHeader.tsx, apps/mobile/src/session/ModelPickerSheet.tsx, apps/mobile/src/session/NativePermissionSheet.ios.tsx, apps/mobile/src/session/NativePermissionSheet.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/PendingSendBubble.tsx, apps/mobile/src/session/PlanModeChip.tsx, apps/mobile/src/session/PluginInvocationHeader.tsx, apps/mobile/src/session/PromptRecommendation.tsx, apps/mobile/src/session/QuoteCapsule.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/RemoteTaskSuggestions.tsx, apps/mobile/src/session/RenameSessionModal.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/RewindPreviewPanel.tsx, apps/mobile/src/session/SentInlineAtomBody.tsx, apps/mobile/src/session/SessionActionSheet.tsx, apps/mobile/src/session/SessionDetailsNative.ios.tsx, apps/mobile/src/session/SessionDetailsNative.tsx, apps/mobile/src/session/SessionHeaderNativeControls.ios.tsx, apps/mobile/src/session/SessionHeaderNativeControls.tsx, apps/mobile/src/session/SessionListDrawer.tsx, apps/mobile/src/session/SessionMenuSheet.tsx, apps/mobile/src/session/SessionOptionsExpoSheet.tsx, apps/mobile/src/session/SessionResourceCards.tsx, apps/mobile/src/session/SessionSearchNative.ios.tsx, apps/mobile/src/session/SessionSearchNative.tsx, apps/mobile/src/session/SessionTailBanner.tsx, apps/mobile/src/session/SessionUsageSummary.tsx, apps/mobile/src/session/ShareImageNativeButton.ios.tsx, apps/mobile/src/session/ShareImageNativeButton.tsx, apps/mobile/src/session/ShareMessageCheckbox.tsx, apps/mobile/src/session/ShareSelectAllButton.tsx, apps/mobile/src/session/ShareSelectionBar.tsx, apps/mobile/src/session/SharedTaskEndedState.tsx, apps/mobile/src/session/SharedTaskScreen.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SlowSendNotice.tsx, apps/mobile/src/session/StreamingStatusText.tsx, apps/mobile/src/session/SwipeableSessionRow.ios.tsx, apps/mobile/src/session/SwipeableSessionRow.tsx, apps/mobile/src/session/TaskTags.tsx, apps/mobile/src/session/TaskTagsSheet.tsx, apps/mobile/src/session/TeammateGenerationLabel.tsx, apps/mobile/src/session/TeammateList.tsx, apps/mobile/src/session/TeammatePicker.tsx, apps/mobile/src/session/UnifiedModelPickerSheet.tsx, apps/mobile/src/session/UnifiedModelPickerView.ios.tsx, apps/mobile/src/session/UnifiedModelPickerView.tsx, apps/mobile/src/session/VoiceRecordingPill.tsx, apps/mobile/src/session/composerRichInputHtml.ts, apps/mobile/src/session/conversationShareWebViewHtml.ts, apps/mobile/src/session/mathWebView.tsx, apps/mobile/src/session/mathWebViewHtml.ts, apps/mobile/src/session/mediaPlayerWebView.tsx, apps/mobile/src/session/mediaPlayerWebViewHtml.ts, apps/mobile/src/session/mermaidWebView.tsx, apps/mobile/src/session/mermaidWebViewHtml.ts, apps/mobile/src/session/selectableMarkdownHtml.ts, apps/mobile/src/session/useSharedTaskConfirmation.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 7 | 237 | 300 || `mobile.chat.sharing` | mobile | 共享任务邀请与成员 | app/shared-session.tsx | AdaptiveWindow, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SharedTaskEndedState, SharedTaskScreen, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, _layout, gestureHandler, peerFileTransport, shared-session, useLocale, useSharedTaskConfirmation | apps/mobile/app/_layout.tsx, apps/mobile/app/shared-session.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SharedTaskEndedState.tsx, apps/mobile/src/session/SharedTaskScreen.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/useSharedTaskConfirmation.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 204 | 61 || `mobile.companions.direct` | mobile | 伙伴私聊回看 | app/companions/direct/[threadId].tsx | AdaptiveWindow, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [threadId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/companions/direct/[threadId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 204 | 53 || `mobile.device-management` | mobile | 设备管理 | app/devices/manage.tsx / app/devices/manage/[deviceId].tsx | AdaptiveWindow, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceInformationFields, DeviceInformationFields.ios, DeviceLinkContext, DeviceManagementDialogs, DeviceManagementList, DeviceManagementList.ios, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, ModalContentArea, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, RenameDeviceModal, ResidentHomeList, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [deviceId], _layout, gestureHandler, manage, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/manage.tsx, apps/mobile/app/devices/manage/[deviceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceInformationFields.ios.tsx, apps/mobile/src/device-link/DeviceInformationFields.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/DeviceManagementDialogs.tsx, apps/mobile/src/device-link/DeviceManagementList.ios.tsx, apps/mobile/src/device-link/DeviceManagementList.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/ModalContentArea.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/RenameDeviceModal.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 204 | 56 |diff --git a/packages/anthropic-compat-proxy/src/server.ts b/packages/anthropic-compat-proxy/src/server.tsindex bfe5690581..aa201e7e30 100644--- a/packages/anthropic-compat-proxy/src/server.ts+++ b/packages/anthropic-compat-proxy/src/server.ts@@ -2482,7 +2482,7 @@ export async function createAnthropicCompatProxy(opts: ProxyOptions): Promise<Prif (requestGuard) {// Compatibility transforms may reintroduce provider-hosted tools. Apply// the same frozen policy at the final outbound boundary as well.- try { outBody = requestGuard.transformBody(outBody); }+ try { outBody = requestGuard.transformBody(outBody, transformCtx); }catch { res.destroy(); return; }}if (outBody.length > maxBodyBytes) {diff --git a/packages/anthropic-compat-proxy/src/types.ts b/packages/anthropic-compat-proxy/src/types.tsindex d7677d247f..66b2a489bf 100644--- a/packages/anthropic-compat-proxy/src/types.ts+++ b/packages/anthropic-compat-proxy/src/types.ts@@ -227,7 +227,8 @@ export interface ProxyOptions {/** Host-owned, request-frozen enforcement before routing, including opaque/local-handler paths.* Throws fail closed. Ordinary requests return null and retain their zero-copy response path. */requestGuard?: (ctx: RequestTransformCtx) => {- transformBody: (body: Buffer) => Buffer;+ // Egress receives the resolved route; ingress has no upstream yet.+ transformBody: (body: Buffer, ctx?: RequestTransformCtx) => Buffer;response: (headers: Readonly<Record<string, number | string | string[] | undefined>>) => Transform;} | null;/** Optional message enforcement. Requires uncompressed RFC6455 negotiation. */diff --git a/packages/maker-shared/src/errorRedaction.test.ts b/packages/maker-shared/src/errorRedaction.test.tsindex acb4d899f4..f9011b57b0 100644--- a/packages/maker-shared/src/errorRedaction.test.ts+++ b/packages/maker-shared/src/errorRedaction.test.ts@@ -5,10 +5,24 @@ import {GATEWAY_PROXY_TOKEN_INVALID_REASON,isCindyGatewayProxyTokenInvalidError,isGatewayProxyTokenInvalidError,+ isResponsesLiteParallelToolCallsError,matchesDeterministicUsageExhaustionText,redactSensitiveText,+ parseAgentErrorCode,} from './errorRedaction.js';+describe('Responses Lite request error classification', () => {+ it('recognizes the upstream error inside a JSON envelope', () => {+ expect(isResponsesLiteParallelToolCallsError(JSON.stringify({ error: {+ message: 'X-OpenAI-Internal-Codex-Responses-Lite requires `parallel_tool_calls` to be false.',+ type: 'invalid_request_error', param: 'parallel_tool_calls', code: 'unsupported_value',+ } }))).toBe(true);+ });+ it.each(['Invalid API key', 'Unsupported effort value', 'parallel_tool_calls is unsupported', ''])('does not misclassify unrelated errors: %s', message => {+ expect(isResponsesLiteParallelToolCallsError(message)).toBe(false);+ });+});+describe('matchesDeterministicUsageExhaustionText', () => {it.each(['insufficient_quota',@@ -243,3 +257,20 @@ describe('isGatewayProxyTokenInvalidError', () => {);});});+++describe('agent error envelopes shared by desktop and mobile', () => {+ it.each(['REMOTE_LOCAL_ONLY_PROVIDER', 'DEVICE_LINK_MEDIA_TRANSFER_FAILED', 'MCP_APPROVAL_CONFIRMATION_TIMEOUT', 'AUTO_REVIEW_UNAVAILABLE'])(+ 'parses %s directly and inside an IPC error', code => {+ for (const prefix of ['', "Error invoking remote method 'maker:send': Error: "]) {+ expect(parseAgentErrorCode(`${prefix}[${code}] first line\nsecond line`)).toEqual({ code, fallback: 'first line\nsecond line' });+ }+ },+ );+ it('preserves the legacy unknown-REMOTE fallback without treating arbitrary bracket text as a code', () => {+ expect(parseAgentErrorCode('[REMOTE_FUTURE] diagnostic')).toEqual({ code: 'REMOTE_FUTURE', fallback: 'diagnostic' });+ expect(parseAgentErrorCode('[REMOTE_FUTURE]')).toEqual({ code: 'REMOTE_FUTURE', fallback: '[REMOTE_FUTURE]' });+ expect(parseAgentErrorCode('[CUSTOM_ERROR] diagnostic')).toBeNull();+ expect(parseAgentErrorCode('prose containing [REMOTE_FUTURE] diagnostic')).toBeNull();+ });+});diff --git a/packages/maker-shared/src/errorRedaction.ts b/packages/maker-shared/src/errorRedaction.tsindex 8f8d05e5c9..7f62c264f4 100644--- a/packages/maker-shared/src/errorRedaction.ts+++ b/packages/maker-shared/src/errorRedaction.ts@@ -196,3 +196,30 @@ export function isCindyGatewayProxyTokenInvalidError(input: {isGatewayProxyTokenInvalidError(input.message ?? ''));}++/** The Lite transport rejects an omitted parallel-tool flag; this is a client request error, not auth. */+export function isResponsesLiteParallelToolCallsError(message: string): boolean {+ return /X-OpenAI-Internal-Codex-Responses-Lite requires `?parallel_tool_calls`? to be false\./i.test(message);+}++const AGENT_CHAT_ERROR_CODES: ReadonlySet<string> = new Set([+ 'DEVICE_LINK_CONTROL_DISABLED',+ 'DEVICE_LINK_MEDIA_TRANSFER_FAILED',+ 'AUTO_REVIEW_UNAVAILABLE',+ 'AUTO_REVIEW_CONFIRM_UNDELIVERED',+ 'MCP_APPROVAL_AUTO_BLOCKED',+ 'MCP_APPROVAL_CONFIRMATION_TIMEOUT',+ 'MCP_APPROVAL_CONFIRMATION_UNAVAILABLE',+]);++/** Parse the existing runtime error envelope, including Electron's IPC wrapper.+ * A parsed code is only a translation candidate: unknown REMOTE codes must not+ * promote their upstream fallback text into localized user-facing guidance.+ */+export function parseAgentErrorCode(message: string): { code: string; fallback: string } | null {+ const match = /(?:^|: Error: )\[([A-Z0-9_]+)\]\s*([\s\S]*)$/.exec(message);+ if (!match || (!/^REMOTE_[A-Z_]+$/.test(match[1]) && !AGENT_CHAT_ERROR_CODES.has(match[1]))) {+ return null;+ }+ return { code: match[1], fallback: match[2] || message };+}