Track multi-agent mode in world state - #34845
Merged
copyberry[bot] merged 1 commit intoJul 22, 2026
Merged
Conversation
## 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
copyberry
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/96b9964d6e5299b07a011c559b68e3d948a49226
branch
from
July 22, 2026 23:58
9584a1a to
0da13c6
Compare
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/96b9964d6e5299b07a011c559b68e3d948a49226
branch
July 22, 2026 23:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Track multi-agent mode in world state
Why
Multi-agent mode instructions are durable model context and need to survive
history changes without re-emitting unrelated setup hints.
What changed
multi_agent_modeworld-state section that diffs, retains, and restoresthe effective mode instructions.
TurnContextItem.multi_agent_modefield for reading older rollouts.mode takes precedence, and bound custom mode text before snapshotting it.
Testing
truncation.
usage hint, and record both modes in world state.