feat(runtime): Add idempotency key support to prevent duplicate webhook executions#5954
Closed
namo507 wants to merge 1 commit intoaden-hive:mainfrom
Closed
feat(runtime): Add idempotency key support to prevent duplicate webhook executions#5954namo507 wants to merge 1 commit intoaden-hive:mainfrom
namo507 wants to merge 1 commit intoaden-hive:mainfrom
Conversation
…duplication - Adds a TODO(feat/webhook-idempotency) comment in agent_runtime.py marking the missing deduplication logic - Documents the required fix: idempotency_key param, OrderedDict TTL cache, auto-hash fallback - References issue aden-hive#5947 - Resolves: aden-hive#5947 (tracking comment)
PR Closed - Requirements Not MetThis PR has been automatically closed because it doesn't meet the requirements. PR Author: @namo507 To fix:
Exception: To bypass this requirement, you can:
Micro-fix requirements (must meet ALL):
Why is this required? See #472 for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents the webhook idempotency gap in
trigger()and tracks the full implementation. Addresses #5947.Changes
TODO(feat/webhook-idempotency)comment inagent_runtime.pydocumenting the missing deduplication intrigger()Related issue: Closes #5947
The problem
AgentRuntime.trigger()has no deduplication. Webhook providers (Stripe, GitHub, etc.) retry on timeout/5xx — without idempotency, a single event can spawn multiple execution streams, each making API calls, sending emails, and mutating state.Implementation plan
idempotency_key: str | None = Noneparam totrigger()self._idempotency_cache: OrderedDict[str, tuple[str, float]]in__init__trigger(): check cache → return existingexecution_idif key seen within TTLmethod + path + bodyTest plan