Files
letta-server/letta/helpers/json_helpers.py
Ani Tunturi 08d3c26732 fix: sanitize control characters before sending to inference backends
Fireworks (via Synthetic Direct) chokes on raw ASCII control chars
(0x00-0x1F) in JSON payloads with "Unterminated string" errors.
The existing sanitize_unicode_surrogates only handles U+D800-DFFF.
Now we also strip control chars (preserving tab/newline/CR) at all
4 request paths — sync, async, and both streaming variants.
2026-03-21 20:23:56 -04:00

6.1 KiB