Repository navigation
feat: deduplicate A2A message processing - #78
murilloimparavel wants to merge 1 commit into
Conversation
Reviewer's GuideIntroduces durable, fail-closed A2A idempotency keyed by agent, conversation, and stable message identity, with request fingerprint validation, cached response replay, explicit duplicate/conflict/expired outcomes, and integration tests plus a database migration. Sequence diagram for durable A2A message deduplicationsequenceDiagram
participant Client
participant A2ARoute as handle_message_send
participant Idempotency as a2a_idempotency
participant Database
participant Agent as run_agent
Client->>A2ARoute: message/send with idempotencyKey
A2ARoute->>Idempotency: request_fingerprint(params)
A2ARoute->>Idempotency: claim_or_replay(...)
Idempotency->>Database: insert processing claim
alt owner
Idempotency-->>A2ARoute: owner
A2ARoute->>Agent: run_agent(...)
Agent-->>A2ARoute: task response
A2ARoute->>Idempotency: complete(..., response)
Idempotency->>Database: store completed response
A2ARoute-->>Client: task response
else completed duplicate
Idempotency-->>A2ARoute: replay, cached response
A2ARoute-->>Client: cached response
else conflicting payload
Idempotency-->>A2ARoute: conflict
A2ARoute-->>Client: 409 payload mismatch
else concurrent duplicate
Idempotency-->>A2ARoute: in_progress
A2ARoute-->>Client: 409 retry shortly
else expired processing claim
Idempotency-->>A2ARoute: expired
A2ARoute-->>Client: 409 operator review required
end
Entity relationship diagram for A2A idempotency recordserDiagram
A2A_IDEMPOTENCY_RECORDS {
uuid id PK
uuid agent_id
string context_id
string idempotency_key
string request_hash
string state
json response
datetime created_at
datetime updated_at
}
AGENT ||--o{ A2A_IDEMPOTENCY_RECORDS : owns
CONVERSATION ||--o{ A2A_IDEMPOTENCY_RECORDS : scopes
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. This changes whether agent execution occurs and persists task responses for up to 24 hours; a wrong key or fingerprint could suppress a legitimate execution or replay an incorrect response, while external tool side effects from duplicate or skipped processing cannot be undone by reverting. The scope is bounded and future behavior can be restored by reverting, but records and any already-triggered effects outlive the revert.
|
Closing: this change is intended for the author's personal fork, not the evolution-foundation upstream. No merge performed. |
Summary\n- Persist idempotency claims and completed A2A responses keyed by agent, conversation, and stable message ID.\n- Reject conflicting payload reuse and concurrent duplicates; avoid replaying expired executions with possible external side effects.\n- Add migration and focused unit/integration coverage.\n\n## Validation\n- Targeted pytest: 13 passed.\n\nMerge this before the matching runtime PR so its retry handling can use the in-progress conflict response. No deployment is included.
Summary by Sourcery
Deduplicate retryable A2A message processing with durable claims and safe response replay.
New Features:
Bug Fixes:
Enhancements:
Tests: