mirror of
https://github.com/openai/codex.git
synced 2026-09-06 15:29:32 +00:00
## Why History estimation and executed-tool-call limits only need the size of serialized JSON, not the serialized output itself. ## What changed - Add a shared `serialized_json_bytes` helper that streams JSON into a byte counter. - Use it for response-item size estimates and executed-tool-call argument limits. - Preserve serialization errors so callers can apply their existing fallback behavior. ## Testing - Cover response-item sizing with escaped characters, newlines, and multibyte text. GitOrigin-RevId: a4417996df96df5c51cae62830adc496912f69c7