(spawn (parameterize ((id 'monitor))
(on (retracted (bot-running $id))
(random-sleep 5)
(bot))))
This could close over the parameterization in the script in the on endpoint. It doesn't at present, meaning that the random-sleep and bot calls run with the parameter at its default value, not 'monitor.
Should it close over the parameterization?