[codex] move live context diffing into world state - #29282
Closed
pakrym-oai wants to merge 14 commits into
Closed
Conversation
This was referenced Jun 21, 2026
pakrym-oai
force-pushed
the
pakrym/full-ci-model-world-state
branch
2 times, most recently
from
June 22, 2026 17:57
92cad21 to
f9b60c8
Compare
Contributor
|
Closing this pull request because it has had no updates for more than 14 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
Model-visible settings diffing was split between the typed environment world state and ad hoc builders in
context_manager/updates.rs. That left the in-memory world baseline incomplete, duplicated initial-context rendering, and meant environment changes during a multi-iteration turn could reach the next sampling request with stale context.This PR is stacked on #29249.
What changed
WorldStatesections for model, permissions, collaboration mode, multi-agent mode, realtime state, and personality; each section owns only its topic comparison and fragment rendering.ContextualUserFragments from world-state rendering and let the context consumer merge adjacent same-role fragments into messages.WorldState::render_full(), including render-only environment subagent data and personality gating; retain model-switch and realtime-shutdown as transition-only overlays.WorldStatesnapshot onContextManagernext to the durableTurnContextItemreference.Testing
just test -p codex-core build_initial_context world_state build_settings_update_items turn_iteration_injects_environment_diff_after_thread_environment_changes fork_startup_context_then_first_turn_diff_snapshot snapshot_model_visible_layout_turn_overrides snapshot_model_visible_layout_resume_with_personality_change multi_agent_mode_is_sticky_and_emits_only_on_change resume_compares_against_previous_effective_multi_agent_mode