Ya it will either eat if HP is too low or when it needs to boost agility lvl to enter the course
Like if you are doing ardy course at lvl 87 it will keep your agiliy lvl at 90
Summer pies have nothing to do with run energy in the script, it's to boost your agility level 5 levels
You don;t need staminas on rooftops, just a few pieces of gracefull and you never run out of energy