mirror of
https://github.com/openai/codex.git
synced 2026-10-25 15:56:38 +00:00
## Why Removing each decoded prefix from a `Vec` shifts all remaining bytes. Repeating that work is costly for streams containing many invalid UTF-8 bytes or many framed messages in one relay record. ## What changed - Buffer unified exec output in a `VecDeque` and use UTF-8 error offsets to consume the largest valid prefix while continuing to make progress on invalid input. - Buffer Noise relay messages in `BytesMut` and advance past decoded frames without moving the remaining bytes. ## Testing Added regression coverage for valid data surrounding invalid UTF-8, front consumption without shifting, and reassembling many JSON-RPC messages from one record. GitOrigin-RevId: 661ccfffc68960ac6c9d37c738224da8ea83cbf0