mirror of
https://github.com/openai/codex.git
synced 2026-10-19 17:28:46 +00:00
## Why A user can reply to a streamed question before its completed message is recorded. Assigning the assistant message's order at completion can place the reply before the question in retained context. ## What changed Reserve an assistant message's order when its source stream starts in thread-owned Guardian context, then reuse that reservation when recording the message. Reserve completion-only messages before publishing their text, and give text and plan output from the same source message a single order. ## Testing Add streaming regression coverage that accepts a reply before the question completes and verifies question-before-reply ordering both live and after resume. Cover server-provided and generated message IDs, plan output, and text combined with a plan. GitOrigin-RevId: cb67e7459c804df7beb0841908244202448c655a