agent: fix test cases