Skip to content

[codex] migrate environment context to world state - #29252

Merged
pakrym-oai merged 4 commits into
pakrym/full-ci-model-world-statefrom
pakrym/full-ci-migrate-environment-world-state
Jun 20, 2026
Merged

[codex] migrate environment context to world state#29252
pakrym-oai merged 4 commits into
pakrym/full-ci-model-world-statefrom
pakrym/full-ci-migrate-environment-world-state

Conversation

@pakrym-oai

Copy link
Copy Markdown
Contributor

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

  • Build EnvironmentsState directly from each turn environment, including its own shell, without a default-shell fallback or intermediate environment DTO.
  • Use EnvironmentsState for initial context and between-turn environment updates.
  • Preserve the legacy single-environment rendering exactly; render multiple environments in sorted order.
  • Serialize and diff only cwd; continue rendering live-only shell, date, timezone, network, filesystem, and subagent values.
  • Move the existing environment rendering support under world_state and migrate the focused rendering, diff, and JSON round-trip coverage.
  • Replace the world-state test macro with explicit mock section types.

Test plan

  • just test -p codex-core world_state
  • just test -p codex-core build_settings_update_items
  • just test -p codex-core build_initial_context
  • just test -p codex-core contextual_user_message

@pakrym-oai
pakrym-oai merged commit e2058d9 into pakrym/full-ci-model-world-state Jun 20, 2026
56 of 59 checks passed
@pakrym-oai
pakrym-oai deleted the pakrym/full-ci-migrate-environment-world-state branch June 20, 2026 19:21
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 20, 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