this code can live outside of test-agent (inside gaia or in its own repo)