Skip to content
AI Knowledge MapSearch / Text directory

After interruption or tool failure, how do I identify completed work and avoid duplicate actions?

D014 · D Organizing complex work · Multi-turn state and interruption recovery

Key answer

Check external state before resuming unfinished work. No success response does not mean nothing happened. Reading failures are often easy to retry; blindly recreating records, resending or rewriting can duplicate results.

Full explanation

AWS illustrates this with resource creation: after a timeout, clients may not know whether a resource exists. Idempotency lets retries using an identifier avoid additional side effects, relying on server support and request IDs rather than an AI instruction alone. Official article

Separate confirmed complete, definitely unexecuted and uncertain sent requests. Resolve uncertainty using record IDs, versions, logs or actual content. For supported idempotent retries, follow identifier and expiry rules.

Resume batch record creation by checking existing records against original item IDs and receipts. Skip correct existing items and create confirmed missing ones. Query uncertain outcomes before creating again. Pause only unresolved items and continue independently confirmed work.

AI should compile this state from tool results; users need not reconstruct everything manually. For files, inspect content/location; for external records, inspect actual target-system entries. Chat completion statements are not substitutes.

After recovery, verify one-to-one input/output coverage without omissions or duplicates. Receipts establish individual calls; final-state checks establish whether the overall task is now correct.

References

1. Malcolm Featonby / AWS (published 2021), Making retries safe with idempotent APIs, Amazon Builders’ Library; Retrying and side effects, Reducing client complexity and Late arriving requests