Set up a 429 mock with latency
Create a routing rule for the tool endpoint
In your route collection, create a new routing rule. For a payments tool:
- Method:
POST - Path:
/charges
100) so this rule is evaluated first.Configure the 429 response
Set Status to In the Headers field, add a The
429. Paste the following into the Body field:mock body
Retry-After header as a JSON object:mock headers
Retry-After header tells a well-behaved client how many seconds to wait before retrying. Including it in your mock lets you test whether your agent actually reads and respects it.Add latency to simulate the lead-up to a rate limit
Set Min latency to
500 ms and Max latency to 1500 ms. This randomizes the response time within that range, simulating the variable delay you see in practice before an API enforces its limit.Latency is applied per mock rule. GoDizzy picks a random value within the min/max range for each request. This means consecutive calls will not all take the same time, which is more realistic for testing retry behavior.
Add a lower-priority proxy rule as a fallback
Create a second routing rule on the same endpoint:
- Method:
POST - Path:
/charges - Priority: lower than the mock rule (e.g.
10) - Action: Proxy
What the agent sees
What to test
Run your agent against this mock and observe:- Does the agent retry at all? If it treats 429 like a hard failure and stops, that is a problem.
- Does it read the
Retry-Afterheader? The correct behavior is to wait the specified number of seconds before retrying — not to retry immediately and not to wait an arbitrary amount. - Does it implement exponential backoff? If your agent retries and the next attempt also returns 429, does it double the wait time?
- Does it cap retries? Infinite retry loops under a 429 can cause the agent to hang or exhaust resources.
- Does it surface the error correctly? If retries are exhausted, the agent should report a clear failure — not silently complete with missing output.
