🛡️ feat: Rate Limiting for Conversation Forking (#8269)

* chore: Improve error logging for fetching conversations, and use new TS packages for utils

* feat: Implement fork limiters for conversation forking requests

* chore: error message for conversation index deletion to clarify syncing behavior

* feat: Enhance error handling for forking with rate limit message
This commit is contained in:
Danny Avila 2025-07-05 15:02:32 -04:00 committed by GitHub
parent 3554625a06
commit 97a99985fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 111 additions and 9 deletions

View file

@ -233,9 +233,17 @@ export default function Fork({
status: 'info',
});
},
onError: () => {
onError: (error) => {
/** Rate limit error (429 status code) */
const isRateLimitError =
(error as any)?.response?.status === 429 ||
(error as any)?.status === 429 ||
(error as any)?.statusCode === 429;
showToast({
message: localize('com_ui_fork_error'),
message: isRateLimitError
? localize('com_ui_fork_error_rate_limit')
: localize('com_ui_fork_error'),
status: 'error',
});
},