Revert "only set agent if it is set"

This reverts commit 0c260d12e090156ecf32fe916a8a6c496d470dec.