Runner retry idempotency: prevent duplicate user-event append #4508
davidahmann
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem observed
Retry/resume paths can append duplicate user events when the same
invocation_idand same user message are submitted again. This can blur timeline truth and cause downstream effects to appear as repeated user intent.Why it matters operationally
Durable agent execution depends on replay-safe event streams. Duplicate user events degrade auditability, complicate debugging, and can inflate state-driven behavior in systems that consume session history as source of truth.
Minimal repro
Fix approach
A runner-level dedupe guard now checks existing session events by
(invocation_id, user content, state_delta)before appending. If a matching user event already exists, append is skipped. Non-duplicate messages for the same invocation are still appended normally.Validation evidence
tests/unittests/test_runners.pyand resume-focused runner tests.Open follow-up question for maintainers
Should this dedupe key evolve to include optional metadata fields as well, or should metadata remain intentionally out-of-band for retry idempotency checks?
This contribution was informed by patterns from Gait: https://github.com/davidahmann/gait
Beta Was this translation helpful? Give feedback.
All reactions