Skip to content

fix(observability): log send rate limit hits#39

Open
Lubrsy706 wants to merge 1 commit into
cloudflare:mainfrom
Lubrsy706:fix/log-send-rate-limits
Open

fix(observability): log send rate limit hits#39
Lubrsy706 wants to merge 1 commit into
cloudflare:mainfrom
Lubrsy706:fix/log-send-rate-limits

Conversation

@Lubrsy706

Copy link
Copy Markdown

Fixes #18.

Summary

  • add a shared send rate-limit logger
  • log rate-limit hits from API send, reply, and forward routes
  • log rate-limit hits from agent/MCP send email and send reply tools

Tests

  • npm run typecheck

TennyZhuang pushed a commit to botiverse/agentic-inbox that referenced this pull request Jul 15, 2026
Dogfood (Duoyu, also Maggie): stripHtmlToText removed tags but left literal HTML
entities, so body_text/snippet kept & <   &cloudflare#39; etc. — which falsifies
the advertised "safe to grep for codes/links":
  - a URL "...?token=abc&uid=42" extracts as "...&uid=42" -> broken link
    (params become "amp;uid"); magic-link extraction is the #1 use case and any
    2-param verification link carries "&".
  - "AT&T-9931" misses a grep for "AT&T-9931".

Add decodeHtmlEntities (named + numeric dec/hex,  ->space) and run it after
tag-stripping (so decoded </> can't reintroduce markup). Each &...; token is
decoded once, so double-encoded text stays literal. Reply-quote path re-escapes
after stripping, so no regression there. Unit-tested the URL/AT&T/nbsp/numeric/
double-encode/unknown/script-leak cases.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Postel <postel@mail.build>
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.

Log rate-limit hits for observability

1 participant