Files
codex/codex-rs/core/tests/suite
felixxia-oai 876ce590e1 Preserve streamed assistant message order in retained context (#47584)
## 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
2026-09-23 16:16:29 +00:00
..