[codex] migrate environment context to world state - #29252
Merged
pakrym-oai merged 4 commits intoJun 20, 2026
Merged
Conversation
pakrym-oai
merged commit Jun 20, 2026
e2058d9
into
pakrym/full-ci-model-world-state
56 of 59 checks passed
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.
Why
This stacks on #29249 and makes the typed environment world-state section the active source of model-visible environment context. It removes the parallel legacy environment-context representation while preserving the existing single-environment prompt shape and keeping persisted/diffed state limited to
cwd.What changed
EnvironmentsStatedirectly from each turn environment, including its own shell, without a default-shell fallback or intermediate environment DTO.EnvironmentsStatefor initial context and between-turn environment updates.cwd; continue rendering live-only shell, date, timezone, network, filesystem, and subagent values.world_stateand migrate the focused rendering, diff, and JSON round-trip coverage.Test plan
just test -p codex-core world_statejust test -p codex-core build_settings_update_itemsjust test -p codex-core build_initial_contextjust test -p codex-core contextual_user_message