feat(autogen): add AG2-015, mutating tool has no idempotency key - #101
feat(autogen): add AG2-015, mutating tool has no idempotency key#101bradAGI 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.
|
Thanks @bradAGI, this is a clean addition and it closes a real gap (every other pack with mutating tools already carries an idempotency rule). I verified the pack against the engine on main: One coordination item before either half merges: you have a second open pair claiming Separately, the rule needs a rationale doc in trustabl-rulebook before it ships; we can handle that on our side or pair on it, no action needed from you there. |
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.