amal66 is teaching Mike's AI calls to fail gracefully
Two changes stop a flaky AI provider from freezing the app or surfacing errors that didn't need to surface.
When a legal-AI tool sends a question to an outside AI service, two things can go wrong: the service stalls and never answers, or it hiccups with a temporary error. amal66's work handles both. The first change caps how long Mike will wait on a silent provider before giving up, so a stalled connection can't hang open and tie up the app indefinitely.
The second is smarter. Instead of blindly retrying every failure, it sorts them first - automatically retrying the temporary ones (rate limits, brief outages, timeouts) while leaving genuine errors like a bad request or a login problem alone. The result is fewer spurious failures landing in front of users, without papering over real problems that need attention.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?