as a person on the other side of the knife, i wouldn’t recommend any strenuous exercise for at least 4 weeks. The no-sex rule is typically for 6 wks.
It really depends on the type of repair-- vaso-vasostomy (sewing the 2 ends of the vas together) or vaso-epididymostomy (sewing the vas back into the epididymis).
The vaso-epi is much more tenuous and you should avoid the strenuous stuff for longer.
Biking will likely be uncomfortable for the full 6 wks.
just be up-front with the doc and find out the type of repair, number of sutures, etc. and it may give you a better idea of when to return to exercise.
swimming is probably fine after a week or two.
good luck with the repair.