code, retryable, and retry guidance together.
Never turn every non-2xx response into the same automatic retry.
Understand the problem response
requestId, status, code, and a
redacted operation label. Do not log bearer tokens, webhook secrets, task
content, memory content, or arbitrary upstream bodies.
Decide what to do next
Distinguish failure from an unknown outcome
A client timeout, interrupted connection, or retryable 5xx does not prove that a mutation failed. For a keyed mutation:- Keep the exact serialized input and original idempotency key.
- Read the returned resource when an identifier is known.
- Otherwise replay the exact request with the same key.
- Accept a matching replay as reconciliation.
- Treat a changed-body
409as evidence that the stored input and retry no longer match.
Inspect headers and body with cURL
Test failure behavior before production
- missing, malformed, under-scoped, and revoked credentials;
- invalid body and over-limit input;
- foreign run, endpoint, delivery, candidate, tenant, and subject identifiers;
- exact mutation replay and changed-body conflict;
429with a bounded retry budget;- client timeout after admission;
- SSE disconnect before terminal state;
- webhook duplicate, invalid signature, and expired timestamp;
- memory provider outage and candidate deletion.