If this is actually intended to be 5Seconds (as I think this is), then this is NOT LGTM.
Specifically, startPingerIfAgent is called *synchronously* during Login, and this is then sleeping for 5 seconds before letting the Login request return.

Now I suppose if this was working with your default wait timeout of 5 (nanoseconds), then maybe we just always hit this right away.
However, you *also* are not checking the returned error of WaitAgentPresence, so we don't actually know if this is working, or if it is just that we sleep long enough or whatever.
This really feels more like a bandaid sleep, rather than a logically correct fix.