From 32618e71e4a64ca203835be28ea48a25358a2e45 Mon Sep 17 00:00:00 2001 From: hansnow Date: Tue, 28 Jul 2026 18:17:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E8=A1=A5=E5=85=85=20Claude=20?= =?UTF-8?q?Sonnet=205=20=E7=8A=B6=E6=80=81=E5=88=AB=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/AccountStatusIndicator.vue | 1 + .../__tests__/AccountStatusIndicator.spec.ts | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/frontend/src/components/account/AccountStatusIndicator.vue b/frontend/src/components/account/AccountStatusIndicator.vue index d8ff410ddc..9c1d25f635 100644 --- a/frontend/src/components/account/AccountStatusIndicator.vue +++ b/frontend/src/components/account/AccountStatusIndicator.vue @@ -229,6 +229,7 @@ const formatScopeName = (scope: string): string => { 'claude-sonnet-4-6': 'CSon46', 'claude-sonnet-4-5': 'CSon45', 'claude-sonnet-4-5-thinking': 'CSon45T', + 'claude-sonnet-5': 'CSon5', // Gemini 2.5 系列 'gemini-2.5-flash': 'G25F', 'gemini-2.5-flash-lite': 'G25FL', diff --git a/frontend/src/components/account/__tests__/AccountStatusIndicator.spec.ts b/frontend/src/components/account/__tests__/AccountStatusIndicator.spec.ts index 545c2abac4..e38f43aa6a 100644 --- a/frontend/src/components/account/__tests__/AccountStatusIndicator.spec.ts +++ b/frontend/src/components/account/__tests__/AccountStatusIndicator.spec.ts @@ -51,6 +51,36 @@ function makeAccount(overrides: Partial): Account { } describe('AccountStatusIndicator', () => { + it('Claude 5 模型限流时显示 Opus 和 Sonnet 的短别名', () => { + const wrapper = mount(AccountStatusIndicator, { + props: { + account: makeAccount({ + extra: { + model_rate_limits: { + 'claude-opus-5': { + rate_limited_at: '2026-07-28T00:00:00Z', + rate_limit_reset_at: '2099-07-28T00:00:00Z' + }, + 'claude-sonnet-5': { + rate_limited_at: '2026-07-28T00:00:00Z', + rate_limit_reset_at: '2099-07-28T00:00:00Z' + } + } + } + }) + }, + global: { + stubs: { + Icon: true + } + } + }) + + expect(wrapper.text()).toContain('COpus5') + expect(wrapper.text()).toContain('CSon5') + expect(wrapper.text()).not.toContain('claude-sonnet-5') + }) + it('Grok 账号额度限流时显示自动恢复时间而非临时不可调度', () => { const wrapper = mount(AccountStatusIndicator, { props: {