Improve API error messages, retry logic, and toast rich colors (#15)
## Improve API error handling and query retry behavior
Improves error messages returned from the chats API to be more descriptive, replacing generic "Not found" and "Invalid character" messages with context-specific ones like "Chat not found" and "Character not found".
Adds a `shouldRetryApiError` utility that prevents React Query from retrying requests that fail with 4xx client errors, since these are deterministic failures that won't resolve on retry. Only 5xx server errors and network-level failures will be retried, up to a maximum of 2 attempts.
Removes the special-case 404 handling in `useChat` that was silently swallowing not-found errors and returning `undefined`, allowing the error to propagate normally instead.
Enables `richColors` on the Sonner toast component so that error and success toasts are visually distinct.
authored by