This is one of the most comprehensive articles I have seen regarding what happens with your HSA contributions when you are enrolled in other plans (such as Tricare) or Medicare
Medicare’s tricky rules on HSAs after age 65
Medicare’s tricky rules on HSAs after age 65