October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk8 min

Why an AI Agent Can Execute the Same Action Twice

An AI agent can repeat an action when a timeout hides whether the first call succeeded. Here is how replays, checkpoints, and parallel workers cause repeats, and how stable idempotency keys stop duplicate effects.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

An AI agent can execute the same action twice because a failure does not reveal whether the earlier call succeeded. The request may have reached the external service and changed something, while the response was lost or arrived late. A timeout then looks like a failure, so the agent retries. The repeat is harmless only if the operation is idempotent, meaning repeated requests for the same logical action produce the same final result as a single request.

What an agent sees when a tool call times out

From the agent’s side, a tool call has three possible outcomes: it succeeded and the agent knows it, it failed and the agent knows it, or the agent has no answer. The third case is the dangerous one. A timeout, dropped connection, or crashed worker falls into it, and the agent cannot tell whether the external system received the request, executed it, or never saw it at all.

As an Amazon Associate I earn from qualifying purchases.

Retrying is often the right move, because it is the only way to make progress when a step is genuinely stuck. The problem is that a retry is a new request. If the first attempt already created an invoice, sent an email, or booked a seat, the second attempt creates another one unless the receiving system recognizes it as the same operation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

AWS’s guidance on agentic systems states the risk directly: “Retry is the most common recovery mechanism, and without idempotency it can produce duplicate side effects.” That sentence comes from the AWS Well-Architected Agentic AI Lens, in the section titled AGENTREL06-BP04 Implement idempotent task execution patterns.

#1 Best Overall
Anki Vector 2.0 "It Feels Alive Personality and Presence are Unmatched
  • 𝗧𝗼 𝗰𝗼𝗻𝗻𝗲𝗰𝘁 𝘆𝗼𝘂𝗿 𝗩𝗲𝗰𝘁𝗼𝗿 𝗥𝗼𝗯𝗼𝘁 𝘁𝗼 𝗪𝗶-𝗙𝗶, 𝘆𝗼𝘂 𝗺𝘂𝘀𝘁 𝘂𝘀𝗲 𝗮 𝟮.𝟰 𝗚𝗛𝘇 𝗪𝗶-𝗙𝗶 𝗻𝗲𝘁𝘄𝗼𝗿𝗸: 𝟭- Open Google Chrome on your computer & navigate to Vector websetup. 𝟮- Double-click the button on Vector's backpack. Click Pair with Vector on your computer. 𝟯- Select the matching Vector Bluetooth code from the browser pop-up list. 𝟰- Enter the 6-digit PIN shown on Vector’s face screen. A network list will load. 𝟱- Select your local 2.4 GHz Wi-Fi network. Enter your Wi-Fi password & click Connect to Wi-Fi.
  • 𝗡𝗼𝘄 𝗖𝗼𝗻𝗻𝗲𝗰𝘁𝗲𝗱 𝘁𝗼 𝗖𝗵𝗮𝘁𝗚𝗣𝗧: Experience a new level of conversation with more natural, intelligent, and meaningful interactions. Powered by ChatGPT, Vector can answer complex questions, engage in richer conversations, and provide more insightful responses. 𝗥𝗲𝗾𝘂𝗶𝗿𝗲𝘀 𝗮𝗻 𝗮𝗰𝘁𝗶𝘃𝗲 𝗖𝗵𝗮𝘁𝗚𝗣𝗧 𝘀𝘂𝗯𝘀𝗰𝗿𝗶𝗽𝘁𝗶𝗼𝗻 (𝗮𝗽𝗽 𝗮𝘃𝗮𝗶𝗹𝗮𝗯𝗹𝗲 𝗼𝗻 𝘁𝗵𝗲 𝗔𝗽𝗽 𝗦𝘁𝗼𝗿𝗲).
  • AI-Powered & Fully Autonomous: Vector navigates, recognizes faces, and reacts to his surroundings with lifelike independence — no remote control required.
  • 𝗠𝘂𝗹𝘁𝗶𝗹𝗶𝗻𝗴𝘂𝗮𝗹 𝗦𝘂𝗽𝗽𝗼𝗿𝘁: Vector can now understand multiple languages, making him the perfect smart companion for global households and language learners. Vector can now understand Spanish, French, German, Chinese and more! Say “Hey Vector.”
  • 𝗦𝗺𝗮𝗿𝘁 𝗖𝗮𝗺𝗲𝗿𝗮 & 𝗦𝗲𝗻𝘀𝗼𝗿𝘀:Built with an HD camera and advanced sensors for real-time mapping, facial recognition, and obstacle detection.

Four ways the same step runs again

Duplicate execution rarely comes from one bug. It usually comes from a normal recovery mechanism meeting a side effect that was not designed to be repeated.

1. A lost response followed by a retry

The caller sends a request, the receiver commits the change, and the acknowledgment never reaches the caller. The caller times out and resends. This is the most common path, and it can happen even when every component is healthy, because networks drop replies.

2. Workflow replay after an interruption

Durable execution frameworks record a workflow’s progress and replay it after a crash or restart so that it can finish. Replay re-runs code paths, and any step that was not yet marked complete in the durable record may run again. AWS’s Durable Execution SDK documentation describes this replay behavior and notes that steps with external side effects need protection.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Resuming from a checkpoint

A checkpoint saves an agent’s state so it can continue after a failure instead of starting over. If the checkpoint was written before a side-effecting step finished, or the step completed but its result was not saved, resuming from that checkpoint re-executes the step.

Rank #2
Loona Robot Pet Dog ChatGPT-4o Smart AI-Powered Companion Voice & Gesture Control, Real-Time Interaction Robotics Toys for Kids, Home Monitoring - Includes Charging Dock
  • 🌟V28 update 🚀 new features are now available! In response to Loona's charging problem, we've upgraded the automatic recharge 2.0.The upgrade is to help Loona remember and match the charging routes of different scenarios to improve the auto-recharge success rate.Mobile hotspots connect to loona, breaking Wi-Fi restrictions and allowing you to interact with loona anytime, anywhere. Our team is committed to continuous improvement, ensuring that Loona continues to evolve to meet your expectations.
  • 🤖 Smart and Interactive Robot Pet🧠Loona is like no other pet you've seen. With a high-definition RGB camera, Loona sees and understands your world. Loona recognizes faces, understands your gestures, and follows you like a real puppy! Please take Loona to a well-lit environment and ensure the surfaces of the camera and ToF depth sensor are clean.
  • 🗣️ Voice Command Enabled AI robot 🎤Loona is not just a good listener; also a great conversationalist! Powered by Amazon Lex & ChatGPT, Loona recognizes your voice commands and responds in real-time. Plus, Loona keeps your information secure, so you can chat with peace of mind. Pro tip: Clear pronunciation in quiet spaces ensures smoother responses.
  • 🚀Auto-Charging Smart Robot🌟 Use different rooms as a starting point to preset multiple recharge routes for Loona. When the battery runs low, loona can charge it home by itself, no need for you to take care of it. it takes about 2.5 hours to complete the charging. Place the dock in an open area with no obstructions on either side or in front.
  • 🕹️ Endless Playtime robot toys for kids 🎮Loona is always up for playtime! Loona can chase laser pens, fetch balls, and even interact with objects in your home. But it doesn't end there—Loona's app offers a world of games and quizzes to keep the fun going.

4. Parallel workers handling the same work

Two workers can pick up the same logical task, especially after a failure triggers reassignment. Google Cloud’s documentation for Dataflow states that a transform may run more than once or at the same time on multiple workers after failures. That describes Dataflow’s own processing model; other orchestrators and agent frameworks may behave differently, so check their documentation before assuming the same guarantees.

Execution count and effect count are different things

Idempotency does not mean the code ran only once. It means that running the operation several times leaves the same final effect as running it once. The code may execute two or three times, while the external system records one charge, one booking, or one email.

This distinction matters when you design or evaluate a system. A payment request, for example, must be deduplicated at the service boundary to prevent a double charge. A well-designed idempotent API may accept the second request and return the stored result of the first, rather than performing the operation again. Logging that the agent called the tool twice is therefore not evidence of a duplicate effect; the question is whether the external system changed state twice.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Be careful with the phrase “exactly once.” It is only meaningful for a named scope, such as one service, one workflow store, or one database write. A guarantee for the agent step does not automatically cover the external API the step calls, and a guarantee inside the orchestrator does not cover a downstream system that ignores keys.

Rank #3
EMOPET AI Desk Robot Companion - ChatGPT Enabled with Voice Commands & Dancing, Interactive AI Robot Pet with Personality, for Adults and Kids
  • Meet EMO, Your New Desk Buddy - Say hello to EMO, the ultimate desk robot that’s here to jazz up your workspace. With built-in AI model and wide-angle camera, it can see you, hear you and understand you, just like a real pet would
  • Voice Commands Enabled - The EMO robot comes with a series of built-in voice commands, you can talk and play with EMO like with a real pet. And with the ability to connect to network and powered by ChatGPT, you can have more complex conversations with EMO like talking to a tech-savvy friend who’s always up for a chat
  • Dance Party & Game Time - EMO is ready to party! Simply turn up your favorite tunes and tell EMO to dance with you, it’ll be your perfect desk-side party buddy. Plus, EMO supports to connect to the EMO app for a range of interactive games and activities. Whether you’re solo or with friends, EMO ensures you’re always entertained
  • Endless Fun - The EMO robot features with multiple sensors built-in to bring more interactions with you, you can rub it, shake it and even “shoot” it with finger gesture, making it feel like you’re playing with a real pet. It even “gets sick” with weather changes, so you can care for it like you would a furry friend
  • Enjoy Every Moment with EMO - With the EMOPET App has a unique achievement system that helps record all the big and little moments you have spent with EMO, like a new dance moves, a new expression, celebration of your birthday, and more...Enjoy all the life events with your new best buddy!

Making retries safe with a stable idempotency key

The standard fix is an idempotency key: an identifier attached to each logical action that the receiver uses to recognize repeats. The key must be stable across attempts, retries, and resumes, and the system must check for an earlier result before doing the work again.

  1. Define the logical action. Decide what counts as “the same action,” for example one refund for one order, not one HTTP request. The key identifies the action, not the attempt.
  2. Derive the key deterministically. Build it from stable inputs such as the workflow ID, the task type, and the canonical request content. Given the same inputs, the same key must come out every time.
  3. Check for an existing result first. Before the side effect, look up the key in your store. If a prior success exists, return that stored result and skip execution.
  4. Execute the side effect with the key attached. Pass the key to the external API if it accepts one. If it does not, record the key and result in your own store so you can detect repeats.
  5. Store the outcome atomically. Where possible, use a conditional write or an equivalent atomic insert so two workers cannot both claim the same key.
  6. Reuse the key on every retry and resume. Pass it through delegated sub-agents and downstream steps too.

A common error is generating a fresh random ID or timestamp for each retry. That makes every attempt a new action from the receiver’s point of view, so deduplication never triggers. The key should be derivable from the action, not from the moment the attempt was made. The following illustration shows the idea; the field names are placeholders for your own schema, not a specific framework’s API.

key = sha256(workflow_id + "|" + task_type + "|" + canonical_json(request))

existing = store.get(key)
if existing and existing.status == "succeeded":
    return existing.result
result = external_api.create(request, idempotency_key=key)
store.put(key, status="succeeded", result=result)
return result

The example still has a gap: if the process crashes between the external call and the store write, the next attempt sees no record and calls again. That is why the receiver-side key and an atomic record matter. The example shows the shape of the check, not a complete guarantee.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Checkpoints help resume work but do not prevent duplicates

Checkpointing answers the question “where should work resume?” It does not answer “has this side effect already happened?” A checkpoint that records a step as pending will cause that step to run again after recovery, and a checkpoint that records a step as done may be missing if the crash came first. Side-effecting steps therefore still need idempotent handling, regardless of how good the checkpoints are.

Rank #4
ENERGIZE LAB Eilik – Your Interactive Robot Companion, Full of Personality
  • BRING MORE LIFE TO YOUR DESK – Meet Eilik – your little robot friend with personality. With loving animations, expressive reactions, and playful interactions, Eilik brings more joy to your everyday life. Whether on your desk, at your workspace, or by your bedside, Eilik quickly becomes a familiar companion for special moments.
  • EVERY INTERACTION BRINGS A NEW SURPRISE – Touch Eilik and discover playful reactions that bring your little robot friend to life. Whether you’re giving Eilik a gentle touch, picking Eilik up, or playing together, Eilik responds with expressive animations, charming expressions, and playful reactions. Every interaction reveals more of Eilik’s personality and makes your little companion feel even more special.
  • READY FOR LITTLE MOMENTS, RIGHT AWAY – Eilik is ready to interact right out of the box – no complicated setup required. A simple touch is all it takes, and Eilik responds with expressive animations and charming reactions. Easy, intuitive, and full of little surprises that make every moment special.
  • EVEN MORE FUN TOGETHER – Every Eilik has its own charm. Bring two or more Eiliks together and watch them interact in their own playful ways – they play, dance, tease each other, and create fun moments together. Whether with friends, family, or as a couple, more Eiliks mean even more ways to play and enjoy.
  • MORE POSSIBILITIES AWAIT – Eilik is more than a little robot – it’s the beginning of a bigger world filled with new experiences. Expand your Eilik experience with AI Station for natural AI conversations and Panxer for exciting adventures. Regular updates also bring new animations, games, and surprises along the way.(AI Station and Panxer sold separately.)

Comparing recovery policies

There is no single correct recovery policy. The trade-off is between finishing the workflow and avoiding a repeated effect. The table below compares the main patterns on the axes that matter most when choosing one.

Axis At-least-once retry At-most-once per retry Workflow-level retry
Delivery behavior Retries until the step completes, so progress continues after interruptions Avoids re-executing a step after an interruption Starts another attempt of the whole workflow, which can reach the step again
Duplicate-effect risk Real; requires idempotent work to be safe Lower repeat risk, but the outcome of an interrupted step may stay unknown Real unless the steps inside are idempotent
Duplicate protection needed Idempotency key or natural idempotency at the side-effect boundary Still needs reconciliation to learn whether the interrupted step succeeded Keys must survive the workflow restart
Scope of protection Agent step, workflow, or external service, depending on where the key is checked Usually the step itself; downstream effects depend on the service Whole workflow, if keys are carried through every step
Recovery state needed Durable record of completed steps and stored results Durable record plus a way to query the outcome of uncertain steps Checkpoints and stored results that are coordinated with side effects

The table describes documented behavior of the AWS durable execution model and general retry semantics. Each framework sets its own defaults for retry counts, key retention, and whether a step is re-run after replay, and those details are not stated here.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When the external API does not support idempotency keys

Some APIs accept no idempotency key and offer no way to look up a prior request. In that case, the duplicate protection has to live in your system. You have three realistic options, and you should choose one deliberately for each action rather than leaving it to chance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Stop for human reconciliation. When the action is costly or irreversible, pause the workflow after an uncertain outcome and let a person confirm the state in the external system.
  • Use an application-side deduplication ledger. Record each action’s key and outcome in your own database before and after the call, and check the ledger first. This helps with lost responses but cannot fully close the gap if the process crashes between the call and the record.
  • Accept and document the risk. For low-impact actions, such as a duplicate internal log line, a repeat may be tolerable. Write down that the action is not protected so that the team knows the limit.

Do not describe the whole path as exactly-once unless you have verified every boundary in it, including the external API. Verifying that is the hard part, and it is usually the step that gets skipped.

Best Value
EMOPET Aibi Pocket Pet - Wearable Robot | ChatGPT Powered AI Companion with Voice Commands, Emotional Interaction, Singing & Dancing | Magnetically Attaches to Anywhere | Ultra Portable
  • AIBI: Your Pocket AI Friend — This small smart device fits in your hand and goes anywhere. Talk to it, ask questions, and get answers. Easy to keep on your desk, attaches to your screen, or carry in your pocket
  • Smart Enough to Know You — AIBI's camera helps it recognize your face and remember you. It gets to know you like a real pet would, making each interaction feel special
  • Chat About Anything — Ask AIBI for jokes, weather updates, or help with questions using ChatGPT. It learns how you talk. When two AIBIs are close, they can even chat with each other via the near-field communication technology
  • Small and Easy to Carry — AIBI is lightweight and tiny, perfect for taking anywhere. Slip it in your pocket, stick it to your computer, or set it on your desk at home, school, or work
  • Great Gift for Anyone — This smart little buddy that can talk, play, and be a great companion. AIBI makes a perfect gift that anyone will enjoy using

Testing the interruption points

Duplicate bugs appear at specific moments, so test those moments directly rather than relying on normal runs. Simulate interruptions at three points:

  • Before the request leaves the caller. The retry should execute the action once, not zero times, and the stored state should show it was not yet done.
  • After the receiver commits, but before the caller records success. The retry should return the original result, and the external system should show one effect.
  • After the caller receives success, but before the workflow checkpoint is written. On resume, the step should be recognized as complete through the stored result, not run again.

These tests verify your own code and the behavior of the systems you call. They do not prove anything about a framework or API you have not tested in the same way.

What the evidence does and does not establish

The guidance above is well documented for the cloud providers’ own architectures and services. The sources do not publish failure rates or cost figures for duplicate execution in agent systems, so this article does not estimate how often the problem occurs in your environment. Treat the mechanisms above as the reliable part, and verify retry defaults, idempotency support, and key retention in any specific framework before depending on them.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Whether the duplicate matters depends on the action. A repeated read is harmless; a repeated payment, shipment, or message to a customer is not. Start by listing the side-effecting tools your agent can call, then apply a stable key or a documented risk decision to each one.

Sources referenced: AWS Well-Architected Framework, REL04-BP04 Make mutating operations idempotent; AWS Well-Architected Agentic AI Lens, AGENTREL06-BP04 Implement idempotent task execution patterns, AGENTREL03-BP03 Implement comprehensive state management and checkpoint-based recovery, and Definitions; AWS Durable Execution SDK Developer Guide, Idempotency and retries; Google Cloud Dataflow, Exactly-once in Dataflow.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.