fix: add timeout for chat requests and improve error handling #49

Merged
shoko merged 1 commits from fix/chat-timeout-handling into main 2026-04-10 06:15:45 +02:00
Owner

Changes

1. Timeout for chat requests

  • Added 30-second timeout using AbortController to prevent hanging requests
  • MiniMax API can be slow or return 529 (overloaded) errors

2. Improved error messages

  • Timeout errors show: "Request timed out. Please try again."
  • Other errors show: "Sorry, I encountered an error. Please try again."

3. API client support

  • Updated to accept optional parameter

Testing

  1. User message should display immediately when sent
  2. If request times out, error message is shown and user can try again
  3. If request succeeds, assistant response is added after
## Changes ### 1. Timeout for chat requests - Added 30-second timeout using AbortController to prevent hanging requests - MiniMax API can be slow or return 529 (overloaded) errors ### 2. Improved error messages - Timeout errors show: "Request timed out. Please try again." - Other errors show: "Sorry, I encountered an error. Please try again." ### 3. API client support - Updated to accept optional parameter ## Testing 1. User message should display immediately when sent 2. If request times out, error message is shown and user can try again 3. If request succeeds, assistant response is added after
shoko added 1 commit 2026-04-10 06:09:43 +02:00
Changes:
1. Add 30-second timeout for chat API requests using AbortController
2. User's message now shows immediately before API response (already done in previous PR)
3. Differentiate between timeout errors and other errors in error messages
4. API client now accepts optional signal parameter for abort support
han approved these changes 2026-04-10 06:15:29 +02:00
han left a comment
First-time contributor

lgtm

lgtm
shoko merged commit af9900d0ba into main 2026-04-10 06:15:45 +02:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/randebu#49