Have the agent intelligently watch console output to terminate when stuck

Related: