Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
feat(bots): 群聊显示远程设备与任务总数限额原因 (#6835)
ylliuuu66dbf5bc80f3d3
diff --git a/apps/desktop/scripts/fixtures/group-control/group-control-fixture.tsx b/apps/desktop/scripts/fixtures/group-control/group-control-fixture.tsxindex ce92841491..881dad326f 100644--- a/apps/desktop/scripts/fixtures/group-control/group-control-fixture.tsx+++ b/apps/desktop/scripts/fixtures/group-control/group-control-fixture.tsx@@ -9,6 +9,7 @@ import { ControlledBanner } from '../../../src/renderer/features/remote-device/Cinterface GroupData {bodyAnswer?: boolean;+ remoteLimits?: boolean;name: string;members: Array<{ botId: string; name: string }>;messages: number;@@ -223,7 +224,10 @@ function groupFrom(data: GroupData) {singleSpeaker: true } : {}),...(data.bubbles || data.arrangement ? { serverBacked: true } : {}),...(data.threadUnread ? { threads: threadSummaries() } : {}),- messages: data.bodyAnswer ? bodyMessages() : data.arrangement ? arrangementMessages(data.arrangement)+ messages: data.remoteLimits ? ['REMOTE_DEVICE_LIMIT', 'REMOTE_TOTAL_LIMIT'].map((runtimeFailureCode, i) =>+ message({ id: `limit-${i}`, sequence: i + 1, kind: 'notice', authorKind: 'system',+ authorBotId: data.members[i].botId, authorName: data.members[i].name, content: '',+ noticeCode: 'member-unavailable', runtimeFailureCode, createdAt: T0 + i * MINUTE })) : data.bodyAnswer ? bodyMessages() : data.arrangement ? arrangementMessages(data.arrangement): bubbles ? bubbles.map(m => (data.threadUnread && UNREAD[m.id as string] ? { ...m, threadUnread: UNREAD[m.id as string] } : m)): Array.from({ length: data.messages }, (_, i) => ({id: `m${i}`,diff --git a/apps/desktop/scripts/fixtures/group-control/ui-page.mjs b/apps/desktop/scripts/fixtures/group-control/ui-page.mjsindex df09a2e719..3884c9a208 100644--- a/apps/desktop/scripts/fixtures/group-control/ui-page.mjs+++ b/apps/desktop/scripts/fixtures/group-control/ui-page.mjs@@ -21,6 +21,11 @@ export default {notCovered:'Sending, round control, real device-link control and revocation, pending interactions, plans and attachments; the bubbles case shows a task snapshot, not a live task; the sidebar is an empty frame',cases: {+ 'remote-limits': {+ about: '#6835: lane-unavailable notices show device and total task limits with recovery advice',+ viewport: { width: 720, height: 700 },+ data: { ...base, sidebar: false, remoteLimits: true },+ },'body-answer': {about: '#6550: component body is readable; literal punctuation and surrounding Markdown are retained',viewport: { width: 720, height: 700 },@@ -82,6 +87,14 @@ export default {},async check(page, ui) {const definition = this.cases[ui.case];+ if (ui.case === 'remote-limits') {+ const timeline = page.getByTestId('bot-group-timeline');+ for (const [i, code] of ['REMOTE_DEVICE_LIMIT', 'REMOTE_TOTAL_LIMIT'].entries()) {+ const expected = (await ui.t(`bots.groupChat.notice.runtimeFailure.${code}`)).replace('{{name}}', members[i].name);+ assert.ok((await timeline.innerText()).includes(expected));+ }+ return;+ }if (ui.case === 'body-answer') {const timeline = page.getByTestId('bot-group-timeline');assert.ok((await timeline.innerText()).includes('保留 <name>、*literal* 和 & 符号'));diff --git a/apps/desktop/src/main/maker-ipc/__tests__/botGroupChatService.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/botGroupChatService.test.tsindex 1fcad2604e..38d6633d96 100644--- a/apps/desktop/src/main/maker-ipc/__tests__/botGroupChatService.test.ts+++ b/apps/desktop/src/main/maker-ipc/__tests__/botGroupChatService.test.ts@@ -478,11 +478,15 @@ describe('botGroupChatService', () => {});it.each([- ['NO_MODEL', 'MODEL_UNAVAILABLE'],- ['MEMBER_UNAVAILABLE', undefined],- ] as const)('preserves the preparation reason %s for a local group without dispatching', async (errorCode, failureCode) => {+ // #6835: unit service entry must retain wrapped lane limits; the old matrix only covered codes.+ ['NO_MODEL', 'MODEL_UNAVAILABLE', 'private preparation details'],+ ['MEMBER_UNAVAILABLE', undefined, 'private preparation details'],+ ['LAZY_CREATE_FAILED', 'REMOTE_DEVICE_LIMIT', '[REMOTE_AGENT_BUSY] [DEVICE_LIMIT] private preparation details'],+ ['LAZY_CREATE_FAILED', 'REMOTE_TOTAL_LIMIT', '[REMOTE_AGENT_BUSY] [TOTAL_LIMIT] private preparation details'],+ ['LAZY_CREATE_FAILED', undefined, '[REMOTE_AGENT_BUSY] private preparation details'],+ ] as const)('preserves the preparation reason %s for a local group without dispatching', async (errorCode, failureCode, message) => {const harness = createHarness(() => null, {- ensureLane: async () => ({ ok: false, errorCode, message: 'private preparation details' }),+ ensureLane: async () => ({ ok: false, errorCode, message }),});const groupId = await createGroup(harness, ['mimi', 'abu']);await harness.service.sendMessage({ groupId, text: '@咪咪 hello', mentions: { all: false, botIds: ['mimi'] }, clientId: 'no-lane' });@@ -829,11 +833,15 @@ describe('botGroupChatService 分工', () => {});it.each([- ['NO_MODEL', 'MODEL_UNAVAILABLE'],- ['MEMBER_UNAVAILABLE', undefined],- ] as const)('preserves the preparation reason %s for a local plan without dispatching', async (errorCode, failureCode) => {+ // #6835: unit service entry must retain wrapped lane limits; the old matrix only covered codes.+ ['NO_MODEL', 'MODEL_UNAVAILABLE', 'private preparation details'],+ ['MEMBER_UNAVAILABLE', undefined, 'private preparation details'],+ ['LAZY_CREATE_FAILED', 'REMOTE_DEVICE_LIMIT', '[REMOTE_AGENT_BUSY] [DEVICE_LIMIT] private preparation details'],+ ['LAZY_CREATE_FAILED', 'REMOTE_TOTAL_LIMIT', '[REMOTE_AGENT_BUSY] [TOTAL_LIMIT] private preparation details'],+ ['LAZY_CREATE_FAILED', undefined, '[REMOTE_AGENT_BUSY] private preparation details'],+ ] as const)('preserves the preparation reason %s for a local plan without dispatching', async (errorCode, failureCode, message) => {const harness = createHarness(() => null, { decidePlan: async () => THREE_STEPS, workDir: fakeWorkDir(),- ensureLane: async () => ({ ok: false, errorCode, message: 'private preparation details' }),+ ensureLane: async () => ({ ok: false, errorCode, message }),});const groupId = await createGroup(harness);const plan = await proposePlan(harness, groupId);diff --git a/apps/desktop/src/main/maker-ipc/__tests__/botGroupRuntimeFailure.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/botGroupRuntimeFailure.test.tsindex a34eadd398..709240c163 100644--- a/apps/desktop/src/main/maker-ipc/__tests__/botGroupRuntimeFailure.test.ts+++ b/apps/desktop/src/main/maker-ipc/__tests__/botGroupRuntimeFailure.test.ts@@ -4,6 +4,10 @@ import { botGroupRuntimeFailureCode, readBotGroupRuntimeFailureDetail, settleUnddescribe('group runtime failure diagnostics', () => {it.each([['NO_MODEL', 'MODEL_UNAVAILABLE'],+ ['[REMOTE_AGENT_BUSY] [DEVICE_LIMIT] private preparation details', 'REMOTE_DEVICE_LIMIT'],+ ['[REMOTE_AGENT_BUSY] [TOTAL_LIMIT] private preparation details', 'REMOTE_TOTAL_LIMIT'],+ ['[REMOTE_AGENT_BUSY] private preparation details', 'RUNTIME_ERROR'],+ ['[DEVICE_LIMIT] private preparation details', 'RUNTIME_ERROR'],['Selected model is at capacity. Please try a different model.', 'UPSTREAM_OVERLOADED'],['overloaded_error', 'UPSTREAM_OVERLOADED'],['the private queue is overloaded', 'RUNTIME_ERROR'],@@ -44,6 +48,10 @@ describe('group runtime failure diagnostics', () => {[{ sdkError: 'rate_limit', message: 'ExceededBudget', errorStatus: 429, usageLimit: true }, 'QUOTA_EXCEEDED'],[{ sdkError: 'model_not_found' }, 'MODEL_UNAVAILABLE'],[{ code: 'NO_MODEL', message: 'private preparation details' }, 'MODEL_UNAVAILABLE'],+ // #6835: unit classification must recover wrapped capacity reasons without publishing diagnostics.+ [{ code: 'LAZY_CREATE_FAILED', message: '[REMOTE_AGENT_BUSY] [DEVICE_LIMIT] private preparation details' }, 'REMOTE_DEVICE_LIMIT'],+ [{ code: 'LAZY_CREATE_FAILED', message: '[REMOTE_AGENT_BUSY] [TOTAL_LIMIT] private preparation details' }, 'REMOTE_TOTAL_LIMIT'],+ [{ code: 'LAZY_CREATE_FAILED', message: '[REMOTE_AGENT_BUSY] private preparation details' }, 'RUNTIME_ERROR'],[{ codexErrorInfo: 'serverOverloaded', message: '[REDACTED]' }, 'UPSTREAM_OVERLOADED'],[{ reason: 'upstream-overload', message: '[REDACTED]' }, 'UPSTREAM_OVERLOADED'],[{ errorStatus: 529, message: '[REDACTED]' }, 'UPSTREAM_OVERLOADED'],diff --git a/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.tsindex d804b99ab8..dbee33e4ca 100644--- a/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts+++ b/apps/desktop/src/main/maker-ipc/__tests__/chatServer.test.ts@@ -664,11 +664,15 @@ describe('Chat Server result delivery and refresh', () => {});it.each([- ['NO_MODEL', 'MODEL_UNAVAILABLE'],- ['MEMBER_UNAVAILABLE', 'RUNTIME_ERROR'],- ])('settles the lane preparation failure %s without dispatching or exposing details', async (errorCode, failureCode) => {+ // #6835: unit service entry must retain wrapped lane limits; the old matrix only covered codes.+ ['NO_MODEL', 'MODEL_UNAVAILABLE', 'private preparation details'],+ ['MEMBER_UNAVAILABLE', 'RUNTIME_ERROR', 'private preparation details'],+ ['LAZY_CREATE_FAILED', 'REMOTE_DEVICE_LIMIT', '[REMOTE_AGENT_BUSY] [DEVICE_LIMIT] private preparation details'],+ ['LAZY_CREATE_FAILED', 'REMOTE_TOTAL_LIMIT', '[REMOTE_AGENT_BUSY] [TOTAL_LIMIT] private preparation details'],+ ['LAZY_CREATE_FAILED', 'RUNTIME_ERROR', '[REMOTE_AGENT_BUSY] private preparation details'],+ ])('settles the lane preparation failure %s without dispatching or exposing details', async (errorCode, failureCode, message) => {fixture.profiles = [{ id: 'local-bot', displayName: 'Bot', avatar: null, status: 'active' }];- deps.ensureLane = vi.fn(async () => ({ ok: false as const, errorCode, message: 'private preparation details' }));+ deps.ensureLane = vi.fn(async () => ({ ok: false as const, errorCode, message }));await vi.advanceTimersByTimeAsync(2000);expect(deps.dispatch).not.toHaveBeenCalled();expect(deps.abortLane).not.toHaveBeenCalled();@@ -717,6 +721,8 @@ describe('Chat Server result delivery and refresh', () => {it.each([['authentication_failed private credential', 'AUTH_REQUIRED'],+ ['[REMOTE_AGENT_BUSY] [DEVICE_LIMIT] private credential', 'REMOTE_DEVICE_LIMIT'],+ ['[REMOTE_AGENT_BUSY] [TOTAL_LIMIT] private credential', 'REMOTE_TOTAL_LIMIT'],['ECONNRESET private endpoint', 'NETWORK_ERROR'],['pi rpc timeout after 30000ms: prompt /private/path', 'RUNTIME_TIMEOUT'],])('classifies an unqueued dispatch rejection from its local message: %s', async (message, code) => {@@ -1274,21 +1280,27 @@ describe('Chat Server result delivery and refresh', () => {expect(retry).toMatchObject({ ok: true, executionFailures: [], hasMore: true });});- it('keeps the specific local failure on an older server and clears the notice after retry', async () => {+ // #6835: unit readback must retain local limit reasons when an older server normalizes unknown codes.+ it.each([+ [undefined, 'IMAGE_INPUT_UNSUPPORTED', 'IMAGE_INPUT_UNSUPPORTED'],+ ['RUNTIME_ERROR', 'REMOTE_DEVICE_LIMIT', 'REMOTE_DEVICE_LIMIT'],+ ['RUNTIME_ERROR', 'REMOTE_TOTAL_LIMIT', 'REMOTE_TOTAL_LIMIT'],+ ['AUTH_REQUIRED', 'REMOTE_DEVICE_LIMIT', 'AUTH_REQUIRED'],+ ] as const)('keeps specific local failures with server code %s and clears them on retry', async (serverCode, localCode, expectedCode) => {await start();- await service.settleLaneTurn({ ...terminal, outcome: 'error', failureCode: 'IMAGE_INPUT_UNSUPPORTED' });+ await service.settleLaneTurn({ ...terminal, outcome: 'error', failureCode: localCode });const source = { id: execution.source_message_id, seq: '7', authorId: selfId, author: { kind: 'human', name: 'Owner' },content: [{ type: 'text', text: 'Question' }], origin: 'user', deleted: false, threadRootId: null, createdAt: '2026-10-03T00:00:00Z' };let status = 'failed';fixture.handle.mockImplementation((route, method, body) => {if (route.includes('/messages?')) return { body: [source] };if (route.includes('/execution-failures?')) return { status: 404, body: { code: 'NOT_FOUND' } };- if (route.endsWith('/executions')) return { body: [{ ...execution, status }] };+ if (route.endsWith('/executions')) return { body: [{ ...execution, status, failure_code: serverCode }] };return response(route);});const failed = await service.getGroup(roomId);if (!failed.ok) throw new Error('group missing');- expect(projectBotGroupExecutionFailures(failed.group.messages, failed.group.executionFailures)[1]).toMatchObject({ runtimeFailureCode: 'IMAGE_INPUT_UNSUPPORTED' });+ expect(projectBotGroupExecutionFailures(failed.group.messages, failed.group.executionFailures)[1]).toMatchObject({ runtimeFailureCode: expectedCode });status = 'queued';const retrying = await service.getGroup(roomId);if (!retrying.ok) throw new Error('group missing');diff --git a/apps/desktop/src/main/maker-ipc/botGroupChatService.ts b/apps/desktop/src/main/maker-ipc/botGroupChatService.tsindex c63a380175..4b80a6e5eb 100644--- a/apps/desktop/src/main/maker-ipc/botGroupChatService.ts+++ b/apps/desktop/src/main/maker-ipc/botGroupChatService.ts@@ -246,8 +246,8 @@ type TurnOutcome =| { kind: 'failed'; notice: BotGroupNoticeCode; failureCode?: BotGroupRuntimeFailureCode }| { kind: 'cancelled' };-function unavailableLaneOutcome(errorCode: string): Extract<TurnOutcome, { kind: 'failed' }> {- const failureCode = botGroupRuntimeFailureCode({ code: errorCode });+function unavailableLaneOutcome(errorCode: string, message: string): Extract<TurnOutcome, { kind: 'failed' }> {+ const failureCode = botGroupRuntimeFailureCode({ code: errorCode, message });// Keep the existing unavailable-member notice when preparation has no specific recovery category.return { kind: 'failed', notice: 'member-unavailable', ...(failureCode !== 'RUNTIME_ERROR' ? { failureCode } : {}) };}@@ -929,7 +929,7 @@ export function createBotGroupChatService(deps: BotGroupChatServiceDeps) {): Promise<TurnOutcome> => {const lane = await deps.ensureLane({ botId: member.botId, groupId: group.id, title: group.name });if (round.cancelled || !scopeIsCurrent(scope)) return { kind: 'cancelled' };- if (!lane.ok) return unavailableLaneOutcome(lane.errorCode);+ if (!lane.ok) return unavailableLaneOutcome(lane.errorCode, lane.message);// A lane must never act on a stale, looser permission profile than its Bot now has.try {await deps.syncLanePermission?.(lane.sessionId, member.botId);@@ -1506,7 +1506,7 @@ export function createBotGroupChatService(deps: BotGroupChatServiceDeps) {plan: { planId, workDir, sessionId: ownerSessionId },});if (!live()) return;- if (!lane.ok) return await settle(unavailableLaneOutcome(lane.errorCode));+ if (!lane.ok) return await settle(unavailableLaneOutcome(lane.errorCode, lane.message));active.sessionId = lane.sessionId;emit(groupId, 'round', scope);try {diff --git a/apps/desktop/src/main/maker-ipc/botGroupRuntimeFailure.ts b/apps/desktop/src/main/maker-ipc/botGroupRuntimeFailure.tsindex fc278a0020..98ceeb288b 100644--- a/apps/desktop/src/main/maker-ipc/botGroupRuntimeFailure.ts+++ b/apps/desktop/src/main/maker-ipc/botGroupRuntimeFailure.ts@@ -1,6 +1,7 @@import { isBotGroupRuntimeFailureCode, type BotGroupRuntimeFailureCode } from '../../shared/botGroupChat.js';import { isPiImageInputUnsupportedError, isPiPromptRpcTimeoutError } from '../../shared/inputError.js';import { extractNonSecretErrorSignals, matchesDeterministicUsageExhaustionText } from '@cindy/maker-shared/error-redaction';+import { remoteAgentLimitErrorKey } from '../../shared/remoteAgentLimits.js';import type { BotGroupChatService } from './botGroupChatService.js';import { parseOverloadError, UPSTREAM_OVERLOAD_REASON } from '@cindy/maker-core';@@ -24,6 +25,9 @@ export function botGroupRuntimeFailureCode(error: unknown): BotGroupRuntimeFailuif (data?.reason === 'pi-prompt-timeout' || isPiPromptRpcTimeoutError(data ?? { message: error })|| (typeof data?.reason === 'string' && /^(?:bridge_)?(?:turn_no_event_timeout|upstream_response_idle_timeout)$/.test(data.reason))) return 'RUNTIME_TIMEOUT';const text = values.filter((value): value is string => typeof value === 'string').join('\n');+ const remoteLimit = remoteAgentLimitErrorKey(text);+ if (remoteLimit === 'chat.remoteError.REMOTE_AGENT_DEVICE_LIMIT') return 'REMOTE_DEVICE_LIMIT';+ if (remoteLimit === 'chat.remoteError.REMOTE_AGENT_TOTAL_LIMIT') return 'REMOTE_TOTAL_LIMIT';const status = typeof data?.errorStatus === 'number' ? data.errorStatus : extractNonSecretErrorSignals(text).errorStatus;if (data?.modelAccessDenied === true || /\b(?:NO_MODEL|MODEL_NOT_FOUND|MODEL_UNAVAILABLE|NO_AVAILABLE_MODEL|BOT_MODEL_REQUIRED|MODEL_REQUIRED|user_model_access_denied)\b/i.test(text)) return 'MODEL_UNAVAILABLE';if (status === 401 || status === 403 || /\b(?:AUTH_REQUIRED|INVALID_TOKEN|TOKEN_EXPIRED|UNAUTHORIZED|invalid_api_key|authentication_error|authentication_failed|provider_auth_or_access)\b/i.test(text)) return 'AUTH_REQUIRED';diff --git a/apps/desktop/src/main/maker-ipc/chatServer.ts b/apps/desktop/src/main/maker-ipc/chatServer.tsindex dc54875354..e76df4b573 100644--- a/apps/desktop/src/main/maker-ipc/chatServer.ts+++ b/apps/desktop/src/main/maker-ipc/chatServer.ts@@ -34,7 +34,7 @@ import { UI_ACTION_TRIGGER_PREFIX } from '../../shared/interruptedTurn.js';import { untrustedJsonBlock } from '../../shared/untrustedPrompt.js';import {BOT_GROUP_ATTACHMENTS_MAX, BOT_GROUP_CLIENT_ID, isBotGroupNoReplyText,- isBotGroupRuntimeFailureCode, type BotGroupRuntimeFailureCode,+ type BotGroupRuntimeFailureCode,readImportedBotGroupRuntimeFailureCode,readBotGroupExecutionFailure, type BotGroupExecutionFailureView,buildBotGroupThreadShareCard, botGroupThreadShareOperationId, readBotGroupThreadShareCard,@@ -1437,7 +1437,8 @@ function createChatServer(local: BotGroupChatService, deps: BotGroupChatServiceDconst cachedCode = failureCodes.get(`${failure.executionId}:${failure.epoch}`);return [{ ...failure, botId: localBot(failure.botId)?.id ?? failure.botId,botName: member ? memberName(member) : actors.find(actor => actor.id === failure.botId)?.name ?? '',- code: !isBotGroupRuntimeFailureCode((row as Record<string, unknown>).failure_code) && cachedCode ? cachedCode : failure.code }];+ // Older servers may normalize a newly introduced category to RUNTIME_ERROR.+ code: failure.code === 'RUNTIME_ERROR' && cachedCode ? cachedCode : failure.code }];});}/** One execution gets one immutable terminal result, regardless of which boundary ends it. */@@ -1654,7 +1655,7 @@ function createChatServer(local: BotGroupChatService, deps: BotGroupChatServiceD...(run.plan?.kind === 'talk' ? { talkPlanId: run.plan.id }: run.plan ? { plan: { planId: run.plan.id, workDir: run.workspace?.workDir ?? '', sessionId: run.workspace?.ownerSessionId ?? undefined } } : {}),...(threadRootId ? { threadRootId } : {}) });- if (!lane.ok) throw new Error(lane.errorCode);+ if (!lane.ok) throw new Error(botGroupRuntimeFailureCode({ code: lane.errorCode, message: lane.message }));run.sessionId = lane.sessionId;run.releaseToolAuthority = registerGroupToolAuthority(lane.sessionId, {botId: bot.id, mode: execution.access_mode,diff --git a/apps/desktop/src/renderer/features/bots/__tests__/BotGroupRuntimeFailureNotice.test.tsx b/apps/desktop/src/renderer/features/bots/__tests__/BotGroupRuntimeFailureNotice.test.tsxindex 467a708eae..f5d5e25813 100644--- a/apps/desktop/src/renderer/features/bots/__tests__/BotGroupRuntimeFailureNotice.test.tsx+++ b/apps/desktop/src/renderer/features/bots/__tests__/BotGroupRuntimeFailureNotice.test.tsx@@ -16,6 +16,17 @@ describe('group failure notice', () => {expect(screen.getByText(/当前模型不支持图片/).textContent).toContain('设置 → 个性化 → 视觉桥');expect(screen.getByText(/当前模型不支持图片/).textContent).toContain('重新发送');});+ // #6835: unit render entry must show the limit and recovery, not an unavailable notice.+ it.each([+ ['REMOTE_DEVICE_LIMIT', '设备'],+ ['REMOTE_TOTAL_LIMIT', '任务总数'],+ ])('explains %s with a recovery action', (code, reason) => {+ render(<BotGroupRuntimeFailureNotice name="Bot" code={code} />);+ const text = screen.getByText(/已达上限/).textContent;+ expect(text).toContain('Bot');+ expect(text).toContain(reason);+ expect(text).toContain('远程与分享');+ });it('does not render an unknown or private diagnostic as group content', () => {const { container } = render(<BotGroupRuntimeFailureNotice name="m" code="private-token-and-path" />);expect(container.textContent).toBe('');diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.jsonindex eed111b10f..734774b3b9 100644--- a/apps/desktop/src/renderer/i18n/locales/en/common.json+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json@@ -9535,6 +9535,8 @@"stepTimeout": "{{name}} took too long, so this step was stopped","stepUnavailable": "{{name}} is unavailable and can’t do this step","runtimeFailure": {+ "REMOTE_DEVICE_LIMIT": "{{name}} can’t reply: the teammate’s device has reached its remote session limit.\nAsk the teammate’s owner to archive unused sessions, or ask the remote computer’s owner to raise the limit in Remote & sharing.",+ "REMOTE_TOTAL_LIMIT": "{{name}} can’t reply: the remote computer has reached its total remote session limit.\nAsk that computer’s owner to release unused sessions or raise the limit in Remote & sharing.","IMAGE_INPUT_UNSUPPORTED": "{{name}} could not reply: the current model does not support images.\nChoose an image-capable model, or enable and configure Vision Bridge in Settings → Personalization, then send your message again.","MODEL_UNAVAILABLE": "{{name}} could not reply: no model is available.\nChoose a connected, available model in the teammate settings, then send your message again.","AUTH_REQUIRED": "{{name}} could not reply: the model connection needs authentication.\nReconnect the model provider in Settings, then send your message again.",diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.jsonindex 5041e53d01..2269586a5f 100644--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json@@ -9501,6 +9501,8 @@"stepTimeout": "{{name}} の作業に時間がかかりすぎたため、このステップを止めました","stepUnavailable": "{{name}} は現在利用できないため、このステップを進められません","runtimeFailure": {+ "REMOTE_DEVICE_LIMIT": "{{name}}は返信できません:この仲間のデバイスのリモートセッション数が上限に達しました。\n仲間の所有者に不要なセッションのアーカイブを依頼するか、リモートのパソコンの所有者に「リモートと共有」で上限の変更を依頼してください。",+ "REMOTE_TOTAL_LIMIT": "{{name}}は返信できません:リモートのパソコンのセッション総数が上限に達しました。\nそのパソコンの所有者に不要なセッションの解放、または「リモートと共有」での上限変更を依頼してください。","IMAGE_INPUT_UNSUPPORTED": "{{name}}は返信できませんでした。現在のモデルは画像に対応していません。\n画像対応モデルに切り替えるか、「設定 → パーソナライズ → ビジョンブリッジ」を有効にして視覚モデルを設定し、メッセージを再送してください。","MODEL_UNAVAILABLE": "{{name}}は返信できませんでした。利用可能なモデルがありません。\n仲間の設定で接続済みの利用可能なモデルを選び、メッセージを再送してください。","AUTH_REQUIRED": "{{name}}は返信できませんでした。モデルの接続に再認証が必要です。\n設定でモデルのプロバイダーに再接続し、メッセージを再送してください。",diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.jsonindex dd986439bc..5bca47610e 100644--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json@@ -9501,6 +9501,8 @@"stepTimeout": "{{name}} 님의 작업이 너무 오래 걸려 이 단계를 멈췄습니다","stepUnavailable": "{{name}} 님을 지금 사용할 수 없어 이 단계를 진행할 수 없습니다","runtimeFailure": {+ "REMOTE_DEVICE_LIMIT": "{{name}}이(가) 답장할 수 없습니다. 이 동료가 있는 기기의 원격 세션 수가 한도에 도달했습니다.\n동료의 소유자에게 사용하지 않는 세션을 보관해 달라고 요청하거나, 원격 컴퓨터의 소유자에게 원격 및 공유에서 한도를 높여 달라고 요청하세요.",+ "REMOTE_TOTAL_LIMIT": "{{name}}이(가) 답장할 수 없습니다. 원격 컴퓨터의 전체 원격 세션 수가 한도에 도달했습니다.\n해당 컴퓨터의 소유자에게 불필요한 세션을 해제하거나 원격 및 공유에서 한도를 높여 달라고 요청하세요.","IMAGE_INPUT_UNSUPPORTED": "{{name}}이(가) 답변하지 못했습니다. 현재 모델은 이미지를 지원하지 않습니다.\n이미지 지원 모델로 전환하거나 설정 → 개인화 → 비전 브리지에서 비전 모델을 활성화하고 설정한 뒤 메시지를 다시 보내세요.","MODEL_UNAVAILABLE": "{{name}}이(가) 답변하지 못했습니다. 사용 가능한 모델이 없습니다.\n동료 설정에서 연결된 사용 가능한 모델을 선택한 뒤 메시지를 다시 보내세요.","AUTH_REQUIRED": "{{name}}이(가) 답변하지 못했습니다. 모델 연결에 재인증이 필요합니다.\n설정에서 모델 제공자에 다시 연결한 뒤 메시지를 다시 보내세요.",diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.jsonindex 9cfd9a8fc6..ba38f556e9 100644--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json@@ -9501,6 +9501,8 @@"stepTimeout": "{{name}}太久没做完,这一步先停下","stepUnavailable": "{{name}}现在不可用,这一步没法做","runtimeFailure": {+ "REMOTE_DEVICE_LIMIT": "{{name}}无法回复:伙伴所在设备保留的远程任务数已达上限。\n请伙伴的主人归档暂时不用的任务,或请远程电脑的主人在“远程与分享”中提高上限。",+ "REMOTE_TOTAL_LIMIT": "{{name}}无法回复:远程电脑保留的任务总数已达上限。\n请那台电脑的主人释放暂时不用的任务,或在“远程与分享”中提高上限。","IMAGE_INPUT_UNSUPPORTED": "{{name}}无法回复:当前模型不支持图片。\n请切换到支持图片的模型,或在「设置 → 个性化 → 视觉桥」开启并配置视觉模型后重新发送。","MODEL_UNAVAILABLE": "{{name}}无法回复:当前没有可用模型。\n请在伙伴设置中选择已连接的可用模型后重新发送。","AUTH_REQUIRED": "{{name}}无法回复:模型连接需要重新认证。\n请在设置中重新连接对应模型来源后重新发送。",diff --git a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.jsonindex 6bdc7dae7c..a76192c849 100644--- a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json@@ -9501,6 +9501,8 @@"stepTimeout": "{{name}}太久沒做完,這一步先停下","stepUnavailable": "{{name}}現在無法使用,這一步沒辦法做","runtimeFailure": {+ "REMOTE_DEVICE_LIMIT": "{{name}}無法回覆:夥伴所在裝置保留的遠端任務數已達上限。\n請夥伴的主人封存暫時不用的任務,或請遠端電腦的主人在「遠端與分享」中提高上限。",+ "REMOTE_TOTAL_LIMIT": "{{name}}無法回覆:遠端電腦保留的任務總數已達上限。\n請那台電腦的主人釋放暫時不用的任務,或在「遠端與分享」中提高上限。","IMAGE_INPUT_UNSUPPORTED": "{{name}}無法回覆:目前模型不支援圖片。\n請切換至支援圖片的模型,或在「設定 → 個性化 → 視覺橋」啟用並設定視覺模型後重新傳送。","MODEL_UNAVAILABLE": "{{name}}無法回覆:目前沒有可用模型。\n請在夥伴設定中選擇已連線的可用模型後重新傳送。","AUTH_REQUIRED": "{{name}}無法回覆:模型連線需要重新驗證。\n請在設定中重新連線對應的模型來源後重新傳送。",diff --git a/apps/mobile/src/__tests__/BotGroupChatScreen.test.tsx b/apps/mobile/src/__tests__/BotGroupChatScreen.test.tsxindex d35a20aeb1..394692c9cf 100644--- a/apps/mobile/src/__tests__/BotGroupChatScreen.test.tsx+++ b/apps/mobile/src/__tests__/BotGroupChatScreen.test.tsx@@ -448,6 +448,15 @@ describe('group timeline', () => {expect(all('botGroup.message.bot')).toHaveLength(0);});+ // #6835: unit screen entry must prioritize the limit over the lane-unavailable fallback.+ it.each(['REMOTE_DEVICE_LIMIT', 'REMOTE_TOTAL_LIMIT'] as const)('renders lane failure %s on mobile', async runtimeFailureCode => {+ await render(group({ messages: [message('failure', 1, { kind: 'notice', authorKind: 'system',+ authorName: 'Bot', noticeCode: 'member-unavailable', runtimeFailureCode })] }));+ const text = all('botGroup.notice')[0]?.textContent;+ expect(text).toContain(`groupChat.notice.runtimeFailure.${runtimeFailureCode}(name=Bot)`);+ expect(text).not.toContain('groupChat.notice.memberUnavailable');+ });+it.each(BOT_GROUP_RUNTIME_FAILURE_CODES)('renders the runtime reason and recovery advice on mobile: %s', async runtimeFailureCode => {await render(group({ messages: [message('failure', 1, { kind: 'notice', authorKind: 'system',authorName: 'Bot', noticeCode: 'member-failed', runtimeFailureCode })] }));diff --git a/apps/mobile/src/i18n/locales/en/groupChat.json b/apps/mobile/src/i18n/locales/en/groupChat.jsonindex b0908402eb..2e56a3ffca 100644--- a/apps/mobile/src/i18n/locales/en/groupChat.json+++ b/apps/mobile/src/i18n/locales/en/groupChat.json@@ -94,6 +94,8 @@"stepTimeout": "{{name}} took too long, so this step was stopped","stepUnavailable": "{{name}} is unavailable and can’t do this step","runtimeFailure": {+ "REMOTE_DEVICE_LIMIT": "{{name}} can’t reply: the teammate’s device has reached its remote session limit.\nAsk the teammate’s owner to archive unused sessions, or ask the remote computer’s owner to raise the limit in Remote & sharing.",+ "REMOTE_TOTAL_LIMIT": "{{name}} can’t reply: the remote computer has reached its total remote session limit.\nAsk that computer’s owner to release unused sessions or raise the limit in Remote & sharing.","IMAGE_INPUT_UNSUPPORTED": "{{name}} could not reply: the current model does not support images.\nChoose an image-capable model, or enable and configure Vision Bridge in Settings → Personalization, then send your message again.","MODEL_UNAVAILABLE": "{{name}} could not reply: no model is available.\nChoose a connected, available model in the teammate settings, then send your message again.","AUTH_REQUIRED": "{{name}} could not reply: the model connection needs authentication.\nReconnect the model provider in Settings, then send your message again.",diff --git a/apps/mobile/src/i18n/locales/ja/groupChat.json b/apps/mobile/src/i18n/locales/ja/groupChat.jsonindex 14a82cde55..ea45963ebe 100644--- a/apps/mobile/src/i18n/locales/ja/groupChat.json+++ b/apps/mobile/src/i18n/locales/ja/groupChat.json@@ -94,6 +94,8 @@"stepTimeout": "{{name}} の作業に時間がかかりすぎたため、このステップを止めました","stepUnavailable": "{{name}} は現在利用できないため、このステップを進められません","runtimeFailure": {+ "REMOTE_DEVICE_LIMIT": "{{name}}は返信できません:この仲間のデバイスのリモートセッション数が上限に達しました。\n仲間の所有者に不要なセッションのアーカイブを依頼するか、リモートのパソコンの所有者に「リモートと共有」で上限の変更を依頼してください。",+ "REMOTE_TOTAL_LIMIT": "{{name}}は返信できません:リモートのパソコンのセッション総数が上限に達しました。\nそのパソコンの所有者に不要なセッションの解放、または「リモートと共有」での上限変更を依頼してください。","IMAGE_INPUT_UNSUPPORTED": "{{name}}は返信できませんでした。現在のモデルは画像に対応していません。\n画像対応モデルに切り替えるか、「設定 → パーソナライズ → ビジョンブリッジ」を有効にして視覚モデルを設定し、メッセージを再送してください。","MODEL_UNAVAILABLE": "{{name}}は返信できませんでした。利用可能なモデルがありません。\n仲間の設定で接続済みの利用可能なモデルを選び、メッセージを再送してください。","AUTH_REQUIRED": "{{name}}は返信できませんでした。モデルの接続に再認証が必要です。\n設定でモデルのプロバイダーに再接続し、メッセージを再送してください。",diff --git a/apps/mobile/src/i18n/locales/ko/groupChat.json b/apps/mobile/src/i18n/locales/ko/groupChat.jsonindex c35a5f50b5..26ada486e1 100644--- a/apps/mobile/src/i18n/locales/ko/groupChat.json+++ b/apps/mobile/src/i18n/locales/ko/groupChat.json@@ -94,6 +94,8 @@"stepTimeout": "{{name}} 님의 작업이 너무 오래 걸려 이 단계를 멈췄습니다","stepUnavailable": "{{name}} 님을 지금 사용할 수 없어 이 단계를 진행할 수 없습니다","runtimeFailure": {+ "REMOTE_DEVICE_LIMIT": "{{name}}이(가) 답장할 수 없습니다. 이 동료가 있는 기기의 원격 세션 수가 한도에 도달했습니다.\n동료의 소유자에게 사용하지 않는 세션을 보관해 달라고 요청하거나, 원격 컴퓨터의 소유자에게 원격 및 공유에서 한도를 높여 달라고 요청하세요.",+ "REMOTE_TOTAL_LIMIT": "{{name}}이(가) 답장할 수 없습니다. 원격 컴퓨터의 전체 원격 세션 수가 한도에 도달했습니다.\n해당 컴퓨터의 소유자에게 불필요한 세션을 해제하거나 원격 및 공유에서 한도를 높여 달라고 요청하세요.","IMAGE_INPUT_UNSUPPORTED": "{{name}}이(가) 답변하지 못했습니다. 현재 모델은 이미지를 지원하지 않습니다.\n이미지 지원 모델로 전환하거나 설정 → 개인화 → 비전 브리지에서 비전 모델을 활성화하고 설정한 뒤 메시지를 다시 보내세요.","MODEL_UNAVAILABLE": "{{name}}이(가) 답변하지 못했습니다. 사용 가능한 모델이 없습니다.\n동료 설정에서 연결된 사용 가능한 모델을 선택한 뒤 메시지를 다시 보내세요.","AUTH_REQUIRED": "{{name}}이(가) 답변하지 못했습니다. 모델 연결에 재인증이 필요합니다.\n설정에서 모델 제공자에 다시 연결한 뒤 메시지를 다시 보내세요.",diff --git a/apps/mobile/src/i18n/locales/zh-CN/groupChat.json b/apps/mobile/src/i18n/locales/zh-CN/groupChat.jsonindex 6b028a9106..df6fd7a7e2 100644--- a/apps/mobile/src/i18n/locales/zh-CN/groupChat.json+++ b/apps/mobile/src/i18n/locales/zh-CN/groupChat.json@@ -94,6 +94,8 @@"stepTimeout": "{{name}}太久没做完,这一步先停下","stepUnavailable": "{{name}}现在不可用,这一步没法做","runtimeFailure": {+ "REMOTE_DEVICE_LIMIT": "{{name}}无法回复:伙伴所在设备保留的远程任务数已达上限。\n请伙伴的主人归档暂时不用的任务,或请远程电脑的主人在“远程与分享”中提高上限。",+ "REMOTE_TOTAL_LIMIT": "{{name}}无法回复:远程电脑保留的任务总数已达上限。\n请那台电脑的主人释放暂时不用的任务,或在“远程与分享”中提高上限。","IMAGE_INPUT_UNSUPPORTED": "{{name}}无法回复:当前模型不支持图片。\n请切换到支持图片的模型,或在「设置 → 个性化 → 视觉桥」开启并配置视觉模型后重新发送。","MODEL_UNAVAILABLE": "{{name}}无法回复:当前没有可用模型。\n请在伙伴设置中选择已连接的可用模型后重新发送。","AUTH_REQUIRED": "{{name}}无法回复:模型连接需要重新认证。\n请在设置中重新连接对应模型来源后重新发送。",diff --git a/apps/mobile/src/i18n/locales/zh-TW/groupChat.json b/apps/mobile/src/i18n/locales/zh-TW/groupChat.jsonindex 5abd27e4c5..db49a1199d 100644--- a/apps/mobile/src/i18n/locales/zh-TW/groupChat.json+++ b/apps/mobile/src/i18n/locales/zh-TW/groupChat.json@@ -94,6 +94,8 @@"stepTimeout": "{{name}}太久沒做完,這一步先停下","stepUnavailable": "{{name}}現在無法使用,這一步沒辦法做","runtimeFailure": {+ "REMOTE_DEVICE_LIMIT": "{{name}}無法回覆:夥伴所在裝置保留的遠端任務數已達上限。\n請夥伴的主人封存暫時不用的任務,或請遠端電腦的主人在「遠端與分享」中提高上限。",+ "REMOTE_TOTAL_LIMIT": "{{name}}無法回覆:遠端電腦保留的任務總數已達上限。\n請那台電腦的主人釋放暫時不用的任務,或在「遠端與分享」中提高上限。","IMAGE_INPUT_UNSUPPORTED": "{{name}}無法回覆:目前模型不支援圖片。\n請切換至支援圖片的模型,或在「設定 → 個性化 → 視覺橋」啟用並設定視覺模型後重新傳送。","MODEL_UNAVAILABLE": "{{name}}無法回覆:目前沒有可用模型。\n請在夥伴設定中選擇已連線的可用模型後重新傳送。","AUTH_REQUIRED": "{{name}}無法回覆:模型連線需要重新驗證。\n請在設定中重新連線對應的模型來源後重新傳送。",diff --git a/docs/dev-rules/protocol-compatibility.md b/docs/dev-rules/protocol-compatibility.mdindex 6293921538..7493988758 100644--- a/docs/dev-rules/protocol-compatibility.md+++ b/docs/dev-rules/protocol-compatibility.md@@ -3288,3 +3288,15 @@ namespace + id 下同一插件的有界 JSON 请求;`deviceSync: true` 是独分享的刷新通知复用已有 `maker:provider:changed` 空载荷,只发给当前被授权的接收方,并核对对应 host。自定义 API 不进入这套策略与新增刷新规则。详细范围及验证见[订阅 Fast 控制交接说明](../subscription-fast-policy.md)。++## 群聊远程任务限额原因(#6835)++既有 `cindy-runtime-error:<code>` detail 与可选 `runtimeFailureCode` 新增安全类别+`REMOTE_DEVICE_LIMIT` / `REMOTE_TOTAL_LIMIT`,不传远程错误正文、设备身份或凭证。+旧客户端不认识新类别时沿用通用失败提示;新客户端消费旧服务器的通用 `RUNTIME_ERROR`+或缺失类别时,仅在本执行端保留同一执行 ID / epoch 的已知具体原因,服务器的其他明确类别优先。+普通回复、话题和分工共用分类与终态提交,不改变重试、租约或权限边界。++跨设备与重启后的具体原因需要 Chat Server 的 detail 解析和 `failure_code` 白名单支持这两个类别;+客户端改动不证明服务端已支持或已部署。未支持时其他查看端保持通用失败,执行端缓存不持久化。+本次不改服务端、数据库、device-link channel 或 Mobile 原生配置。diff --git a/docs/product-rules/bot-group-chat.md b/docs/product-rules/bot-group-chat.mdindex c0af3f433a..54f18f3a83 100644--- a/docs/product-rules/bot-group-chat.md+++ b/docs/product-rules/bot-group-chat.md@@ -201,6 +201,9 @@ Chat Server 声明 `capabilities.groupSingleSpeaker: 1` 时,服务器群按下本地成员和分工步骤的计时器超时同样带上 `RUNTIME_TIMEOUT`,保留等待用户批准时暂停计时的规则。明确的额度耗尽优先于泛化 429,明确的暂时限流不会因 `usageLimit` 标记误报为额度耗尽。直接发送拒绝也在执行端分类本地 `message`,跨群仍只提交白名单错误类别。+ 远程任务名额不足在创建专线与发送失败时保留本地诊断并分类:`DEVICE_LIMIT` / `TOTAL_LIMIT`+ 分别投影为 `REMOTE_DEVICE_LIMIT` / `REMOTE_TOTAL_LIMIT`,双端提示释放闲置任务或由远程电脑主人提高上限;+ 不自动清理连接或调整上限,未带具体限额标记的 `REMOTE_AGENT_BUSY` 沿用未知错误回退。Chat Server 是执行状态的唯一事实来源:消息页只包含真实历史,另通过`/execution-failures?sourceIds=<已加载消息 ID>` 读取当前读者可见、源消息未删除的完整失败状态(执行 ID、epoch、源消息 ID、伙伴、计划和白名单错误类别)。每次最多查询 100 个源 ID,@@ -220,7 +223,9 @@ Chat Server 声明 `capabilities.groupSingleSpeaker: 1` 时,服务器群按下Desktop 与 Mobile 仅在服务器盖章的 import/系统通知历史中恢复类别,也兼容此前已迁移的标记,不把普通用户发送的同名卡片或标记当成错误提示,标记不进入历史预览或模型正文。新服务器返回安全的 `failure_code`;旧服务器仍接受既有 `detail` 字符串,新客户端在当前执行端- 缓存具体原因,其他设备或重启后降级为通用失败提示。实现与回归见+ 缓存具体原因;服务器把新类别归为 `RUNTIME_ERROR` 时也保留同一执行 ID 与 epoch 的本地具体原因,+ 服务器返回其他明确类别时以服务器为准。其他设备或重启后的具体原因依赖服务器白名单支持,+ 未支持时降级为通用失败提示。实现与回归见`maker-ipc/botGroupRuntimeFailure.ts`、`maker-ipc/__tests__/chatServer.test.ts`。手机回归见 `botGroupRemote.test.ts`、`chatServerClient.test.ts`、`BotGroupChatScreen.test.tsx`。- 应用退出或重启会结束进行中的一轮;重启后不自动续跑。diff --git a/packages/maker-shared/src/botGroupChat.ts b/packages/maker-shared/src/botGroupChat.tsindex 010e8f44d4..fa079d54c9 100644--- a/packages/maker-shared/src/botGroupChat.ts+++ b/packages/maker-shared/src/botGroupChat.ts@@ -48,6 +48,7 @@ export type BotGroupMemberStatus = 'active' | 'paused' | 'error' | 'archived' |export const BOT_GROUP_RUNTIME_FAILURE_CODES = ['IMAGE_INPUT_UNSUPPORTED', 'MODEL_UNAVAILABLE', 'AUTH_REQUIRED', 'RATE_LIMITED', 'UPSTREAM_OVERLOADED','QUOTA_EXCEEDED', 'NETWORK_ERROR', 'RUNTIME_TIMEOUT', 'RUNTIME_ERROR',+ 'REMOTE_DEVICE_LIMIT', 'REMOTE_TOTAL_LIMIT',] as const;export type BotGroupRuntimeFailureCode = typeof BOT_GROUP_RUNTIME_FAILURE_CODES[number];export function isBotGroupRuntimeFailureCode(value: unknown): value is BotGroupRuntimeFailureCode {