Add repartition logic
Fix get-agent.py