agent: fix up agent endpoint error messages