fix(webhook): make intake fan-out-safe and structurally valid (Webhook Revolution) - #85618
Closed
andrexibiza wants to merge 5 commits into
Closed
fix(webhook): make intake fan-out-safe and structurally valid (Webhook Revolution)#85618andrexibiza wants to merge 5 commits into
andrexibiza wants to merge 5 commits into
Conversation
Task 10. Closes NousResearch#7448, NousResearch#55829. - Idempotency keyed by (profile, route, delivery_id) and bound to a body hash. Same delivery on different routes executes each route once (NousResearch#7448); same-route retry returns 200 duplicate; conflicting replay (same key, different body) returns 409. - Raw payload {__raw__} renders as a structurally valid JSON envelope {payload, truncated, original_bytes} instead of raw character slicing that produced invalid JSON (NousResearch#55829). - Rate-limit responses emit Retry-After. - Prune cleans the body-hash cache alongside the TTL cache. - New HTTP-contract tests: fan-out dedupe, cross-route execute, 409 conflict, raw-payload JSON envelope.
Collaborator
Contributor
Author
|
Superseded by #85523 (same Task 10 intake work, cleaner branch). Closing duplicate. |
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.
Part of the Webhook Revolution campaign. Task 10. Closes #7448, #55829.
Fan-out-safe idempotency
Idempotency now keyed by
(profile, route, delivery_id)and bound to a body hash. The same provider delivery sent to different routes executes each route once (#7448); a same-route retry returns 200 duplicate; a conflicting replay (same key, different body) returns 409.Structurally valid raw payload
{__raw__}renders as a valid JSON envelope{"payload": <bounded>, "truncated": bool, "original_bytes": N}instead of raw character slicing that produced invalid JSON (#55829). Output always parses.HTTP contract hardening
Rate-limit responses emit
Retry-After. Prune cleans the body-hash cache alongside the TTL cache.Verification (53 passed)
tests/gateway/test_webhook_http_contract.py— 4 new tests (cross-route execute, same-route dedupe, 409 conflict, JSON envelope).test_webhook_adapter.py+test_webhook_integration.py+test_webhook_dynamic_routes.py+test_webhook_deliver_only.py+test_webhook_signature_rate_limit.py— no regression.git diff --checkclean;webhook.py1455 lines (< 2000).