Skip to content

The decisioning dispatcher turns IdempotencyConflictError into INTERNAL_ERROR #1622

Description

@bokelley

Observed

A decisioning platform method wrapped with IdempotencyStore.wrap raises IdempotencyConflictError (an ADCPTaskError) on a key reused with a different payload. _invoke_platform_method in adcp/decisioning/dispatch.py catches only AdcpError and pydantic ValidationError specifically. Everything else goes to the generic except Exception branch, so the buyer receives INTERNAL_ERROR / terminal instead of the idempotency conflict.

The non-decisioning serve() path translates AdCP-typed exceptions such as IdempotencyConflictError (see the comments around serve.py:3385); the decisioning dispatcher doesn't.

Reproduction

In any decisioning platform, decorate a mutating method with @store.wrap, call it twice with the same idempotency_key and different payloads, and inspect the wire error: INTERNAL_ERROR, details.caused_by = "IdempotencyConflictError". In the Embedded Sales Agent, removing its translate_idempotency_conflict decorator from core/platforms/mock.py turns test_idempotency_conflict_wire_envelope_mcp / _a2a into INTERNAL_ERROR.

Expected

The dispatcher projects ADCPTaskError subclasses (or at least IdempotencyConflictError) to their own wire error, as the serve() path does.

Impact

Every decisioning adopter that uses IdempotencyStore.wrap needs its own translator. ESA keeps translate_idempotency_conflict (core/idempotency.py) for this.

Activity

  1. added a commit that references this issue on Oct 26, 2026
    042c21a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions