Skip to content

feat(autogen): add AG2-015, mutating tool has no idempotency key - #101

Open
bradAGI wants to merge 1 commit into
trustabl:mainfrom
bradAGI:feat/ag2-015-idempotency
Open

feat(autogen): add AG2-015, mutating tool has no idempotency key#101
bradAGI wants to merge 1 commit into
trustabl:mainfrom
bradAGI:feat/ag2-015-idempotency

Conversation

@bradAGI

@bradAGI bradAGI commented Aug 24, 2026

Copy link
Copy Markdown

Paired with the engine PR on a branch of the same name, so rules-sync resolves this pack. Neither should merge alone.

The gap

Six packs ship an idempotency rule. AutoGen does not:

pack rule pack rule
Claude Agent SDK CSDK-006 / CSDK-016 MCP MCP-007
OpenAI Agents SDK OAI-009 / OAI-019 CrewAI CREW-006
Google ADK ADK-006 Pydantic AI PYD-007
AutoGen — none —

AG2-015 uses the same name_has_prefix + param_name_matches predicate pair as CREW-006, at the same medium / 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:

  • The tool response is a message in a conversation that is re-sent in full on every later turn. A call whose result read as inconclusive does not scroll away — it stays visible and re-invitable for the rest of the run.
  • In a 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_payment can 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:

Derive the key from the request's own identity, not from a fresh uuid4() per call — a key regenerated on the retry deduplicates nothing.

A parameter named idempotency_key filled 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

AG2-015 [medium] refund_payment tools.py:6

The sample's second tool is the same refund_payment with an idempotency_key parameter threaded through to the backing call; the rule did not fire on it.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant