A teenager who was watched by officers dealing to addicts from his mountain bike has been spared jail due to his age.