mirror of
https://github.com/openai/codex.git
synced 2026-10-24 18:18:41 +00:00
## Why Pipe output chunks can split one protocol frame or contain several frames. A timed-out read must also retain any partial frame it already consumed so the next exchange can continue decoding it. ## What changed Add a stateful `MessageReader` that buffers partial input, preserves unread bytes from coalesced chunks, and validates frame bounds before reading the payload. Use it for voice helper handshake and shutdown responses. ## Testing Add async tests for fragmented and coalesced frames, cancelled reads, oversized headers, truncated and malformed input, and invalid pipe chunk sizes. GitOrigin-RevId: 274d9698e05f2de2147235b6e4e1bd38dbb7c23b