Skip to content

fix(sdk): execute the first message to a freshly-joined peer exactly once [INT-969]#477

Merged
AlexanderZ-Band merged 10 commits into
mainfrom
feat/a2agatewayadapter-processes-the-first-message-to-a-INT-969
Jul 23, 2026
Merged

fix(sdk): execute the first message to a freshly-joined peer exactly once [INT-969]#477
AlexanderZ-Band merged 10 commits into
mainfrom
feat/a2agatewayadapter-processes-the-first-message-to-a-INT-969

Conversation

@AlexanderZ-Band

@AlexanderZ-Band AlexanderZ-Band commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Prevents freshly joined A2A Gateway peers from processing the first inbound message more than once.

  • Coordinates per-room delivery claims across recreated contexts
  • Retries failed acknowledgements without replaying side effects
  • Reclaims durable completion caches when rooms are removed

Validation

CI green; 2 live A2A gateway tests passed.

Green regressions locking current single-context guarantees:
- The gateway sequence (message posted before the peer's context is live,
  delivered via /next with the WebSocket copy arriving mid-execution)
  executes the handler exactly once.
- Cancellation mid-processing releases the local in-flight claim.

Red targets defining the desired lifecycle, to turn green with the fix:
- Two live contexts for one room execute a shared message once.
- ACK_PENDING state survives LRU pressure instead of being evicted into
  a side-effect replay on redelivery.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jul 22, 2026

Copy link
Copy Markdown

INT-969

AlexanderZ-Band and others added 8 commits July 22, 2026 10:28
Arrange ACK_PENDING and the cache overflow via _process_event with a
failing durable ack instead of poking the bookkeeping directly, and give
the retry budget headroom so eviction surfaces as the actual hazard: a
handler replay on redelivery.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Evicting a completed-but-unacked message from the ack-pending map turned
redelivery into a full handler replay of already-executed side effects.
Ack-pending entries have a bounded exit of their own (each retry either
succeeds or the retry budget promotes the message to completed), so the
LRU cap on this map was never needed for growth control.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AlexanderZ-Band
AlexanderZ-Band marked this pull request as ready for review July 22, 2026 09:18
@AlexanderZ-Band
AlexanderZ-Band requested a review from a team July 22, 2026 09:19
@AlexanderZ-Band
AlexanderZ-Band merged commit 1125b08 into main Jul 23, 2026
14 checks passed
@AlexanderZ-Band
AlexanderZ-Band deleted the feat/a2agatewayadapter-processes-the-first-message-to-a-INT-969 branch July 23, 2026 07:06
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.

2 participants