(#22324) Rely on vardir defined by agent instead of hardset path