mirror of
https://github.com/openai/codex.git
synced 2026-10-19 17:28:46 +00:00
## Why Multi-agent mode instructions are durable model context and need to survive history changes without re-emitting unrelated setup hints. ## What changed - Add a `multi_agent_mode` world-state section that diffs, retains, and restores the effective mode instructions. - Persist mode changes in world-state snapshots while keeping the legacy `TurnContextItem.multi_agent_mode` field for reading older rollouts. - Keep initial mode instructions after the root-agent usage hint so the active mode takes precedence, and bound custom mode text before snapshotting it. ## Testing - Add snapshot coverage for mode transitions, retained history, and custom-text truncation. - Verify live mode changes preserve instruction ordering, avoid duplicating the usage hint, and record both modes in world state. GitOrigin-RevId: 96b9964d6e5299b07a011c559b68e3d948a49226