Persist selected environments in turn context replay#20520
Draft
starr-openai wants to merge 19 commits intomainfrom
Draft
Persist selected environments in turn context replay#20520starr-openai wants to merge 19 commits intomainfrom
starr-openai wants to merge 19 commits intomainfrom
Conversation
Route session runtime cwd and MCP startup state through selected turn environments so multi-environment turns avoid a parallel legacy Environment field. Keep fallback behavior for local/no-selection sessions and add focused coverage for duplicate selections, cwd resolution, and MCP runtime environment selection. Validation: git diff --check Co-authored-by: Codex <[email protected]>
Resolve relative cwd updates against turn-local environment selections, and keep the TurnContext helper surface minimal. Co-authored-by: Codex <[email protected]>
Co-authored-by: Codex <[email protected]>
Co-authored-by: Codex <[email protected]>
Keep environment cwd ownership on explicit environment selections, tighten MCP runtime environment fallback, and clarify resolved environment projection naming. Co-authored-by: Codex <[email protected]>
Route the remaining validation convenience API through resolve_environment_selections and keep the resolver tests attached to the resolver itself. Co-authored-by: Codex <[email protected]>
Keep the explicit turn-environment cwd assertion focused on the selected environment cwd, and remove fallback wording from the RMCP stored-environment test identifiers. Co-authored-by: Codex <[email protected]>
Add the test-only imports and current McpServerConfig fields required by the rebased branch, and derive Debug for ResolvedTurnEnvironments so resolver error tests compile under Bazel. Co-authored-by: Codex <[email protected]>
Use the shared test PathBufExt import for RMCP integration tests and run environment selection tests that touch the local executor under Tokio. Co-authored-by: Codex <[email protected]>
Use turn-local environments for pending MCP refreshes, keep disabled-environment sessions startable when no MCP servers are enabled, and reject ambiguous cwd plus explicit environment updates. Co-authored-by: Codex <[email protected]>
Add the required argument comment for the default-environment fallback flag. Co-authored-by: Codex <[email protected]>
Co-authored-by: Codex <[email protected]>
Co-authored-by: Codex <[email protected]>
Keep selected environment cwd scoped to resolved turn environments, remove fallback helpers added during review, and preserve existing MCP default/local fallback behavior inline. Co-authored-by: Codex <[email protected]>
Preserve environment cwd as an explicit environment-selection value, and keep session cwd updates scoped to session configuration only. Co-authored-by: Codex <[email protected]>
Remove the RMCP integration test added during the environment-selection review pass so this PR does not carry that broader test change. Co-authored-by: Codex <[email protected]>
4b258a0 to
549a864
Compare
Co-authored-by: Codex <[email protected]>
This was referenced May 1, 2026
ec16f73 to
8f7e2ed
Compare
2190528 to
1d64860
Compare
8f7e2ed to
a22b112
Compare
Apply turn-level cwd overrides to the primary selected environment only for the active turn so runtime cwd, environment context diffs, and app-server turn-start behavior stay aligned without rewriting stored sticky environment selections. Co-authored-by: Codex <[email protected]>
1d64860 to
4deeb8d
Compare
a22b112 to
d843cf6
Compare
Co-authored-by: Codex <[email protected]>
d843cf6 to
97e1ace
Compare
4deeb8d to
5a0b31b
Compare
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.
Summary\n- persist selected turn environments into TurnContextItem rollout history\n- restore selected environments when replaying, resuming, and forking threads\n- add focused replay coverage so thread state stays aligned with reconstructed history\n\n## Testing\n- not run\n