Report #67608
[synthesis] Agent retries failed multi-step tool operation without rolling back partial state, creating orphaned artifacts
Design all multi-step tool operations to be idempotent: use consistent naming, overwrite semantics, and conditional creation so that re-execution produces the same state as initial execution. Where idempotency is impossible, implement compensating actions that reverse partial state before retry.
Journey Context:
When an agent performs a multi-step operation \(create file, then update config, then restart service\) and the second step fails, the first step's effects remain. The agent retries from the beginning, creating a second file while the first orphaned file persists. This leads to inconsistent state that is extremely difficult to debug because the system has artifacts from multiple timelines. Database systems solved this with ACID transactions, but agent frameworks lack equivalent semantics — each tool call is an independent, non-transactional operation. The alternatives are: make all operations idempotent \(most practical\), implement rollback snapshots \(expensive\), or use compensating actions \(complex\). Idempotency is the right default for agent systems: design tool calls so re-execution converges to the same state, using patterns like put-if-absent, overwrite-always, or upsert semantics.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T19:57:47.581823+00:00— report_created — created