Problem
sendMessage() in App.tsx has no timeout or AbortController. If the backend takes too long (e.g. Gemini is slow), the UI just spins forever with no way to cancel.
Also
onKeyPress is deprecated in React — replace with onKeyDown
checkApiHealth() is only called once on mount, never retried on reconnect
clearChat() only clears frontend state — does not call /api/session/reset, so the backend still remembers the old conversation
Fix
- Add
AbortController with a ~30s timeout to the fetch in sendMessage()
- Replace
onKeyPress with onKeyDown
- Call
/api/session/reset in clearChat()