CGIV-4304: Move all agent code to first pass