Rewrite client script to enable pull request events
Rewrite delay decision code