Skip to content

perf(webhook): prune request caches incrementally - #46065

Merged
teknium1 merged 1 commit into
mainfrom
hermes/webhook-ttl-pruning
Jun 14, 2026
Merged

perf(webhook): prune request caches incrementally#46065
teknium1 merged 1 commit into
mainfrom
hermes/webhook-ttl-pruning

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Webhook POST handling now prunes request caches incrementally instead of rebuilding TTL lists/dicts on every accepted request.

Changes

  • gateway/platforms/webhook.py: store per-route rate-limit windows as deques and prune expired timestamps from the left.
  • gateway/platforms/webhook.py: check idempotency TTL for the current delivery ID directly, with occasional bounded stale-cache cleanup.
  • gateway/platforms/webhook.py: track delivery-info creation order so TTL pruning only walks stale entries until the first fresh one.
  • tests/gateway/test_webhook_adapter.py: cover incremental rate-limit pruning, per-delivery idempotency expiry, and ordered delivery-info pruning.

Validation

Check Result
Focused regression set 5 passed in 0.17s
Webhook adapter suite 68 passed in 0.50s
Targeted webhook files 82 passed in 0.7s
Syntax/diff checks py_compile + git diff --check passed

Notes

  • Preserves HMAC auth, rate limiting, idempotency, deliver_only, and delivery-info retention semantics.
  • The untracked .plans/speed-optimization-audit.md remains intentionally excluded from this PR.

Infographic

Webhook Cache Pruning

@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/webhook-ttl-pruning vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 10893 on HEAD, 10893 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5725 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@teknium1
teknium1 merged commit afc8615 into main Jun 14, 2026
28 checks passed
@teknium1
teknium1 deleted the hermes/webhook-ttl-pruning branch June 14, 2026 09:40
AIalliAI pushed a commit to AIalliAI/Hermes that referenced this pull request Jun 14, 2026
zapabob pushed a commit to zapabob/hermes-agent that referenced this pull request Jun 15, 2026
T02200059 pushed a commit to T02200059/hermes-agent that referenced this pull request Jun 18, 2026
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
Methodician added a commit to Methodician/hermes-agent that referenced this pull request Jul 4, 2026
habarmc1223-sudo pushed a commit to habarmc1223-sudo/hermes-agent-fluxmem that referenced this pull request Jul 8, 2026
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
@zapabob zapabob mentioned this pull request Jul 21, 2026
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
@zapabob zapabob mentioned this pull request Aug 12, 2026
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.

1 participant