Back to Blog
openclaw mcp agent-workflows reliability idempotency

OpenClaw Tool Timeouts: Prevent Duplicate Writes Before You Retry

A personal agent sends a request to create a calendar event. The calendar service saves it, but the response never reaches the agent. The tool times out. Should the agent try again?

Not until it knows what happened—or can rely on the destination's documented deduplication contract. A timeout describes the caller's observation, not necessarily the remote operation's outcome.

That distinction has a timely OpenClaw connection. The 2026.11.5-beta.2 pre-release notes include a fix to retain timeout results so interrupted tools are not mistaken for confirmed failures without side effects. The notes link to PR #180247, “preserve tool timeout outcomes”. This is a specific recovery improvement, not a promise that every connected service now prevents duplicate writes. See the official release notes for the version and pre-release status.

For self-hosted OpenClaw and MCP workflows, the practical next step is to define what happens after an unknown write outcome.

Keep “unknown” separate from “failed”

Use three outcome categories in your integration or workflow record:

Outcome Evidence Next action
Confirmed success Destination returns a receipt, or a reliable lookup finds the exact operation Record its destination ID; do not create it again
Confirmed rejection The service's documented response establishes that the operation was rejected without committing Fix the cause before a permitted retry
Unknown Timeout, disconnected response, interrupted caller, or ambiguous server error Reconcile with the destination before deciding

These are proposed workflow categories, not OpenClaw configuration keys. A generic error message is not enough to put a write into the second row. Likewise, stopping the local run is not proof that a remote service rolled back its work.

Consider an agent that publishes a weekly report. If the publish request times out after the server commits, a new request can create a second report. If the workflow also sends a notification, rerunning the entire workflow may duplicate both operations. Treat publication and notification as separate effects with separate receipts.

Give each intended write a durable identity

Before the first attempt, persist a small operation record. For example:

{
  "operation_id": "weekly-report-2026-11-12-team-a",
  "action": "publish_report",
  "destination_scope": "team-a-reports",
  "payload_digest": "sha256-of-canonical-payload",
  "status": "prepared",
  "destination_id": null
}

This is an illustrative application record, not a payload to send to an arbitrary MCP server. Keep credentials and report contents out of the record unless they are genuinely needed and protected.

The identity should represent one intended effect, not one network attempt. A retry keeps the same identity and payload. An intentionally revised report is a different operation, or an explicit update to an existing destination object—not a silent reuse of the previous request key with changed arguments.

If the destination documents idempotency support, use its specified field or header and respect its retention window and scope. Do not assume that inventing an Idempotency-Key header adds support. AWS's Builders' Library explanation describes why reusing a unique client request identifier can make retries safe when the service implements that contract. It also distinguishes semantically equivalent responses from byte-for-byte identical ones: an existing resource may have progressed from pending to running.

An MCP tool wrapper must actually carry that identity through to the underlying service. Merely exposing an API through MCP does not establish a retry guarantee.

Reconcile before repeating the write

After an ambiguous outcome, follow this sequence:

  1. Mark the operation unknown. Preserve the attempt time, request identity, and any partial receipt. Do not mark the whole workflow successful or silently start over.
  2. Query the authoritative destination. Prefer a receipt/status endpoint or a lookup by the original operation identifier. Check the intended account, project, and resource—not just a matching title.
  3. If the exact effect exists, attach its ID and continue. Resume after the completed write rather than replaying earlier steps.
  4. If it is not visible, assess the lookup contract. A paginated list, limited access, or eventually consistent search may not prove absence. Follow documented visibility delays and use bounded rechecks, not a rapid polling loop.
  5. Retry only under a justified rule. Reuse a valid service-supported idempotency key, or rely on documented evidence that no commit occurred. Otherwise stop for review rather than guessing.

When no reliable lookup or deduplication mechanism exists, that is a real automation limit. For high-impact writes, keep an ambiguous result paused until someone can verify the destination. For low-impact internal work, an operator may choose a different risk policy—but the duplicate risk should be explicit.

Test the missing-response case, not only the happy path

Use a staging destination and harmless synthetic records. The essential test is a service that commits the operation but loses or delays the response beyond the caller's deadline.

Test Acceptance criterion
Normal successful write One destination object; its ID is stored
Commit followed by lost response Outcome remains unknown until reconciled; no blind second create
Retry with the same supported key One intended effect within the documented key lifetime
Same key with changed payload Workflow blocks the mismatch or handles the service's documented rejection
Agent restarts after commit Durable record allows reconciliation without replaying the write
Two workers resume the same operation A durable claim and/or destination deduplication prevents concurrent duplicate effects
Lookup temporarily misses the object Workflow does not interpret the first empty result as authoritative absence

These are recommended tests, not results from a Clawly deployment. Record the OpenClaw version, tool adapter version, destination API behavior, and observed object count when you run them. Do not enable a beta in production solely to satisfy this checklist.

What the November fix does—and does not—change

OpenClaw's release notes and linked change support the narrow claim that timeout outcomes are being preserved more carefully. AWS's independent API guidance supports the broader design principle: safe retries depend on a service contract and stable request identity, not optimism at the caller.

Neither establishes end-to-end exactly-once behavior for your particular agent workflow. That still depends on the destination, adapter, durable operation record, concurrency controls, and recovery path.

The operational rule is simple: after a write times out, ask “did it commit?” before asking “should I retry?”

Protect your AI agent with Clawly

Deploy your OpenClaw agent in an isolated, hardened container with encrypted credentials and managed updates. No DevOps required.

Deploy Your Agent