Files
OmniRoute/tests
adevwithpurpose 587e53a3c1 fix(compression): cap countTextTokens at 50k chars and strip base64 data URIs (#10118)
Fixes #10117 — countTextTokens can block the worker event loop for tens of
seconds when a Codex request carries a large base64 image payload, wedging
/healthz and every concurrent request.

- Strip base64 image data URIs before encoding (images are not text)
- Fast-path length guard: over 50k chars, skip the near-quadratic pure-JS
  tokenizer and return the chars/4 heuristic

Co-authored-by: adevwithpurpose <adevwithpurpose@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
2026-08-14 00:57:19 -03:00
..