[agent] Only patch deps once