feat(autogen): add AG2-015, mutating tool has no idempotency key - #101
Open
bradAGI wants to merge 1 commit into
Open
feat(autogen): add AG2-015, mutating tool has no idempotency key#101bradAGI wants to merge 1 commit into
bradAGI wants to merge 1 commit into
Conversation
Claude, OpenAI, Google ADK, MCP, CrewAI and Pydantic AI all ship an idempotency rule (CSDK-006/016, OAI-009/019, ADK-006, MCP-007, CREW-006, PYD-007). AutoGen shipped none. Same name_has_prefix + param_name_matches predicate pair as CREW-006, at the same medium / 0.55. The explanation names the retry paths AutoGen adds over a single-agent loop: the tool response is a message in a conversation re-sent in full on every later turn, so an inconclusive call stays visible and re-invitable for the rest of the run, and in a group chat any speaker the manager selects can re-issue it — including an agent that was not the original caller and cannot know the side effect already committed. The fix text also names the mistake that defeats the fix: deriving the key from a fresh uuid4() per call deduplicates nothing, because the retry regenerates it.
This was referenced Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The gap
Six packs ship an idempotency rule. AutoGen does not:
AG2-015uses the samename_has_prefix+param_name_matchespredicate pair as CREW-006, at the samemedium/0.55.Why it matters specifically here
The generic argument is that retries re-run side effects. AutoGen supplies more ways for the retry to happen than a single-agent loop does, and both come from its conversation model:
GroupChat, any speaker the manager selects can re-issue it — including an agent that was not the original caller, and therefore cannot know the side effect already committed.So the window in which a duplicate
refund_paymentcan fire is the whole run, and the agent that fires it may be one with no memory of the first attempt.The fix text names the non-fix
Worth flagging, because it is the common way this gets "fixed" wrongly:
A parameter named
idempotency_keyfilled with a fresh UUID at each call satisfies the rule while providing no deduplication at all. The rule cannot see this; the text says so.Verified end to end
The sample's second tool is the same
refund_paymentwith anidempotency_keyparameter threaded through to the backing call; the rule did not fire on it.