Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(mobile): 补齐换模型建议的电脑位置指引

nanad0567034cf8a
diff --git a/apps/mobile/src/__tests__/BotGroupChatScreen.test.tsx b/apps/mobile/src/__tests__/BotGroupChatScreen.test.tsx
index d452813de4..12eac8c1c9 100644
--- a/apps/mobile/src/__tests__/BotGroupChatScreen.test.tsx
+++ b/apps/mobile/src/__tests__/BotGroupChatScreen.test.tsx
@@ -526,9 +526,11 @@ describe('group timeline', () => {
expect(all('botGroup.notice')[0]?.textContent).not.toContain(`groupChat.notice.runtimeFailure.${runtimeFailureCode}.details`);
});
- it('keeps computer setup guidance inside details in a thread', async () => {
- await render(group({ messages: [message('auth-failure', 1, { kind: 'notice', authorKind: 'system',
- authorName: 'Bot', noticeCode: 'member-failed', runtimeFailureCode: 'AUTH_REQUIRED' })] }), 'ready', 'thread-root');
+ // #7769: model-switch advice must retain its computer location after disclosure.
+ it.each(['AUTH_REQUIRED', 'RATE_LIMITED', 'UPSTREAM_OVERLOADED', 'RUNTIME_TIMEOUT'] as const)(
+ 'keeps computer setup guidance inside thread details: %s', async runtimeFailureCode => {
+ await render(group({ messages: [message('failure', 1, { kind: 'notice', authorKind: 'system',
+ authorName: 'Bot', noticeCode: 'member-failed', runtimeFailureCode })] }), 'ready', 'thread-root');
const notice = all('botGroup.notice')[0]!;
expect(notice.textContent).not.toContain('groupChat.notice.runtimeFailureSetupHint');
const toggle = [...notice.querySelectorAll('button')].find(button => button.textContent === 'session.tail.showErrorDetails')!;
diff --git a/apps/mobile/src/session/BotGroupRuntimeFailureNotice.tsx b/apps/mobile/src/session/BotGroupRuntimeFailureNotice.tsx
index 87a23d4611..cd66a77828 100644
--- a/apps/mobile/src/session/BotGroupRuntimeFailureNotice.tsx
+++ b/apps/mobile/src/session/BotGroupRuntimeFailureNotice.tsx
@@ -11,6 +11,7 @@ export function BotGroupRuntimeFailureNotice({ code, name }: {
const { t } = useTranslation();
const needsComputer = code === 'IMAGE_INPUT_UNSUPPORTED' || code === 'MODEL_UNAVAILABLE'
|| code === 'AUTH_REQUIRED' || code === 'QUOTA_EXCEEDED'
+ || code === 'RATE_LIMITED' || code === 'UPSTREAM_OVERLOADED' || code === 'RUNTIME_TIMEOUT'
|| code === 'REMOTE_DEVICE_LIMIT' || code === 'REMOTE_TOTAL_LIMIT';
const guidance = t(`groupChat.notice.runtimeFailure.${code}.details`);
const details = needsComputer