Skip to content

Conversation

@AnthonyAlcaraz
Copy link

Summary

This PR improves responsiveness when using the Happy app on mobile networks with variable latency.

Changes:

  • Reduce socket.io reconnection delay from 1000ms to 500ms for faster recovery after disconnections
  • Reduce max reconnection delay from 5000ms to 3000ms
  • Reduce activity update debounce from 2000ms to 500ms for faster terminal feedback
  • Add 15-second timeout wrapper for voice session operations to prevent hanging on poor networks

Root Cause Analysis

The mobile terminal execution was slow due to:

  1. Long reconnection delays - Socket.io defaults were tuned for desktop reliability, not mobile responsiveness
  2. Activity updates throttled to 2 seconds - The ActivityUpdateAccumulator debounced ephemeral updates for 2 seconds, creating noticeable lag for terminal feedback
  3. No timeout on session start - startRealtimeSession() could hang indefinitely on poor networks

Test Plan

  • Test on mobile device with good WiFi - should feel snappier
  • Test on cellular network - reconnections should recover faster
  • Test with poor network conditions - session start should timeout gracefully instead of hanging
  • Verify typecheck passes (yarn typecheck)

Impact

These are safe, conservative changes:

  • Reconnection delays are still reasonable (500ms-3000ms)
  • Activity debounce of 500ms is still enough to batch rapid updates
  • 15-second timeout is generous while preventing indefinite hangs

Generated with Claude Code

- Reduce socket.io reconnection delay from 1000ms to 500ms for faster recovery
- Reduce max reconnection delay from 5000ms to 3000ms
- Reduce activity update debounce from 2000ms to 500ms for faster terminal feedback
- Add 15s timeout wrapper for voice session operations to prevent hanging on poor networks

These changes improve responsiveness when using the app on mobile networks
with variable latency.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant