Wrapped ws.onmessage in try-catch to capture full stack trace when errors occur during message handling. This will help identify where the 'Cannot read properties of undefined' error is coming from. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>