Skip to content
ML Academy

LLMs, GenAI, RAG, agents, evaluation · insight-1562

Treat a timed-out write as unknown and read back before retrying

Evidence type
practitioner heuristic
Difficulty
medium
Roles
ML engineer
Industries
e-commerce, aviation

Summary: situation, action, reason, boundary

  1. Situation

    A write tool, such as issuing a voucher, times out after the request left, and the agent is about to call it again.

  2. Action

    Return an explicit unknown outcome for timeouts, and have the agent or the wrapper query the system of record by a natural key to see whether the change exists before any retry or user message.

  3. Reason

    A timeout says the response was not received, not that the action did not occur.

  4. Boundary

    Side-effecting tools over networks, especially those without idempotency keys.

Symptom or risk

The first call actually succeeded, so the retry issues a second voucher, or the agent reports failure for something that happened.

Exceptions

Where the API supports idempotency keys, a keyed retry is simpler and safe.

Trade-offs

A read-back needs a lookup path and a stable natural key.

Pitfalls

Reading from a replica that lags behind the write.

Lessons and concepts