Skip to content

Track multi-agent mode in world state - #34845

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/96b9964d6e5299b07a011c559b68e3d948a49226
Jul 22, 2026
Merged

Track multi-agent mode in world state#34845
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/96b9964d6e5299b07a011c559b68e3d948a49226

Conversation

@copyberry

@copyberry copyberry Bot commented Jul 22, 2026

Copy link
Copy Markdown

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

  • 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.

## 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
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/96b9964d6e5299b07a011c559b68e3d948a49226 branch from 9584a1a to 0da13c6 Compare July 22, 2026 23:58
@copyberry
copyberry Bot merged commit 0da13c6 into main Jul 22, 2026
19 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/96b9964d6e5299b07a011c559b68e3d948a49226 branch July 22, 2026 23:59
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant