Surface multi-environment choices in environment context#20646
Merged
Conversation
Render explicit environment choices in the live environment context for multi-environment turns, while keeping replay and persistence on the legacy cwd-only surface for now. Co-authored-by: Codex <noreply@openai.com>
Inline the multi-environment render condition in EnvironmentContext and leave a short comment explaining why single-environment turns keep the legacy cwd-only surface. Co-authored-by: Codex <noreply@openai.com>
Inline the model-facing environment initialization in from_turn_context so the multi-environment rendering path reads in one place. Co-authored-by: Codex <noreply@openai.com>
Keep the environment context render focused on the explicit environment choices and cwd values without surfacing a separate default marker. Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
db43360 to
3acd99c
Compare
pakrym-oai
reviewed
May 1, 2026
| #[derive(Debug, Clone, PartialEq, Eq)] | ||
| pub(crate) struct EnvironmentContextEnvironment { | ||
| pub(crate) id: String, | ||
| pub(crate) cwd: PathBuf, |
pakrym-oai
reviewed
May 1, 2026
pakrym-oai
reviewed
May 1, 2026
| <cwd>/repo/remote</cwd> | ||
| </environment> | ||
| </environments> | ||
| <shell>bash</shell> |
Collaborator
There was a problem hiding this comment.
probably should be nested in environment.
pakrym-oai
approved these changes
May 1, 2026
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
This was referenced May 1, 2026
Use platform-aware absolute test paths in the environment context tests so the Windows Bazel lane does not try to construct AbsolutePathBuf values from Unix-only /repo paths. Co-authored-by: Codex <noreply@openai.com>
Update the prompt caching helper to assert the environment shell metadata rendered by EnvironmentContext instead of the platform default user shell. Co-authored-by: Codex <noreply@openai.com>
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
The model needs a way to see which environments are available during a multi-environment turn without changing the legacy single-environment prompt surface or pulling replay/persistence changes into the same review.
Stack
EnvironmentContextrendering for selected environments (this PR)environment_idroutingWhat Changed
environment_contextso multi-environment turns render an<environments>block with the selected environment ids and cwd valuescodex-rs/core/src/context/environment_context_tests.rsTesting