mirror of
https://github.com/openai/codex.git
synced 2026-11-18 22:20:48 +00:00
## Why A first user turn and a concurrent raw response-item injection can both observe that the session has no reference context. Both can then append the initial prompt prefix and persist a full world-state snapshot. ## What changed Allow context preparation to run concurrently, then serialize publication of the initial prefix and its checkpoints. If injection publishes first, the user turn computes its context updates against the published baseline. If the user turn publishes first, injection appends only the caller-provided items. ## Testing Add an integration test that forces the overlap in both preparation orders. It checks the first request's world-state updates, verifies that the follow-up request contains the initial instructions and injected content once each, and checks that history contains one full snapshot. GitOrigin-RevId: b66f9c6ccc5d42a2be0e852b4d83b78adbc9e5b2