agent: Add test to prevent bad query names