Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix(hetero-agent): show the active rate limit cycle (#17159)

Arvin Xu72395d4e7db3
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.json
index 91c418da3b8..12d80563232 100644
--- a/locales/en-US/chat.json
+++ b/locales/en-US/chat.json
@@ -103,9 +103,11 @@
"cliOverloadedGuide.title": "{{name}} is temporarily overloaded",
"cliRateLimitGuide.actions.openSystemTools": "Open System Tools",
"cliRateLimitGuide.actions.retry": "Retry message",
- "cliRateLimitGuide.afterReset": "This account has reached its weekly usage limit. You can continue after {{resetAt}}.",
+ "cliRateLimitGuide.afterReset": "This account has reached its current usage limit. You can continue after {{resetAt}}.",
+ "cliRateLimitGuide.afterResetWithLimitType": "This account has reached its {{limitType}} usage limit. You can continue after {{resetAt}}.",
"cliRateLimitGuide.desc": "{{name}} has reached its current usage limit and cannot continue this run right now.",
"cliRateLimitGuide.limitType": "Quota cycle",
+ "cliRateLimitGuide.limitTypes.fiveHourCycle": "5-hour window",
"cliRateLimitGuide.limitTypes.weekCycle": "Weekly",
"cliRateLimitGuide.relative.day_one": "{{count}} day",
"cliRateLimitGuide.relative.day_other": "{{count}} days",
diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.json
index 25cae4b3abd..9ad96d3652e 100644
--- a/locales/zh-CN/chat.json
+++ b/locales/zh-CN/chat.json
@@ -103,9 +103,11 @@
"cliOverloadedGuide.title": "{{name}} 服务暂时繁忙",
"cliRateLimitGuide.actions.openSystemTools": "打开系统工具",
"cliRateLimitGuide.actions.retry": "重试这条消息",
- "cliRateLimitGuide.afterReset": "当前账号已达到本周使用上限,{{resetAt}} 后可继续使用。",
+ "cliRateLimitGuide.afterReset": "当前账号已达到当前使用上限,{{resetAt}} 后可继续使用。",
+ "cliRateLimitGuide.afterResetWithLimitType": "当前账号已达到{{limitType}}使用上限,{{resetAt}} 后可继续使用。",
"cliRateLimitGuide.desc": "{{name}} 已达到当前使用上限,这次运行暂时无法继续。",
"cliRateLimitGuide.limitType": "额度周期",
+ "cliRateLimitGuide.limitTypes.fiveHourCycle": "5 小时周期",
"cliRateLimitGuide.limitTypes.weekCycle": "每周",
"cliRateLimitGuide.relative.day_one": "{{count}} 天",
"cliRateLimitGuide.relative.day_other": "{{count}} 天",
diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.ts
index e21cd566665..865dca2b0a1 100644
--- a/packages/locales/src/default/chat.ts
+++ b/packages/locales/src/default/chat.ts
@@ -601,10 +601,13 @@ export default {
'cliRateLimitGuide.actions.openSystemTools': 'Open System Tools',
'cliRateLimitGuide.actions.retry': 'Retry message',
'cliRateLimitGuide.afterReset':
- 'This account has reached its weekly usage limit. You can continue after {{resetAt}}.',
+ 'This account has reached its current usage limit. You can continue after {{resetAt}}.',
+ 'cliRateLimitGuide.afterResetWithLimitType':
+ 'This account has reached its {{limitType}} usage limit. You can continue after {{resetAt}}.',
'cliRateLimitGuide.desc':
'{{name}} has reached its current usage limit and cannot continue this run right now.',
'cliRateLimitGuide.limitType': 'Quota cycle',
+ 'cliRateLimitGuide.limitTypes.fiveHourCycle': '5-hour window',
'cliRateLimitGuide.limitTypes.weekCycle': 'Weekly',
'cliRateLimitGuide.relative.day_one': '{{count}} day',
'cliRateLimitGuide.relative.day_other': '{{count}} days',
diff --git a/src/features/Electron/HeterogeneousAgent/StatusGuide/states/RateLimitState.tsx b/src/features/Electron/HeterogeneousAgent/StatusGuide/states/RateLimitState.tsx
index ea937f3063c..20eac4e1e26 100644
--- a/src/features/Electron/HeterogeneousAgent/StatusGuide/states/RateLimitState.tsx
+++ b/src/features/Electron/HeterogeneousAgent/StatusGuide/states/RateLimitState.tsx
@@ -62,6 +62,10 @@ const RateLimitState = ({
return t('cliRateLimitGuide.limitTypes.weekCycle');
}
+ if (rateLimitType === 'five_hour') {
+ return t('cliRateLimitGuide.limitTypes.fiveHourCycle');
+ }
+
return rateLimitType.replaceAll('_', ' ');
}, [error?.rateLimitInfo?.rateLimitType, t]);
// The "~X h Y m" duration string, reused both for the header hint and the
@@ -154,11 +158,17 @@ const RateLimitState = ({
? relativeDuration
? t('cliRateLimitGuide.schedule.scheduledForApprox', { duration: relativeDuration })
: t('cliRateLimitGuide.schedule.scheduledAfterReset')
- : t('cliRateLimitGuide.afterReset', {
- resetAt: formattedResetAt
- ? `${formattedResetAt}${timezoneLabel ? ` (${timezoneLabel})` : ''}`
- : t('cliRateLimitGuide.resetUnknown'),
- })}
+ : t(
+ rateLimitTypeLabel
+ ? 'cliRateLimitGuide.afterResetWithLimitType'
+ : 'cliRateLimitGuide.afterReset',
+ {
+ limitType: rateLimitTypeLabel,
+ resetAt: formattedResetAt
+ ? `${formattedResetAt}${timezoneLabel ? ` (${timezoneLabel})` : ''}`
+ : t('cliRateLimitGuide.resetUnknown'),
+ },
+ )}
</Text>
}
>