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()
Problem
sendMessage()inApp.tsxhas no timeout orAbortController. If the backend takes too long (e.g. Gemini is slow), the UI just spins forever with no way to cancel.Also
onKeyPressis deprecated in React — replace withonKeyDowncheckApiHealth()is only called once on mount, never retried on reconnectclearChat()only clears frontend state — does not call/api/session/reset, so the backend still remembers the old conversationFix
AbortControllerwith a ~30s timeout to the fetch insendMessage()onKeyPresswithonKeyDown/api/session/resetinclearChat()