Skip to content

Persist selected environments in turn context replay#20520

Draft
starr-openai wants to merge 19 commits intomainfrom
process-tools-stage2-turn-context-replay
Draft

Persist selected environments in turn context replay#20520
starr-openai wants to merge 19 commits intomainfrom
process-tools-stage2-turn-context-replay

Conversation

@starr-openai
Copy link
Copy Markdown
Contributor

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

starr-openai and others added 16 commits April 30, 2026 15:26
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]>
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]>
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]>
@starr-openai starr-openai force-pushed the process-tools-stage2-turn-context-replay branch 3 times, most recently from 4b258a0 to 549a864 Compare May 1, 2026 02:05
@starr-openai starr-openai force-pushed the process-tools-stage2-turn-context-replay branch 3 times, most recently from ec16f73 to 8f7e2ed Compare May 1, 2026 02:51
@starr-openai starr-openai force-pushed the turncontext-env-stage1-combined branch 2 times, most recently from 2190528 to 1d64860 Compare May 1, 2026 03:01
@starr-openai starr-openai force-pushed the process-tools-stage2-turn-context-replay branch from 8f7e2ed to a22b112 Compare May 1, 2026 03:03
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]>
@starr-openai starr-openai force-pushed the turncontext-env-stage1-combined branch from 1d64860 to 4deeb8d Compare May 1, 2026 03:12
@starr-openai starr-openai force-pushed the process-tools-stage2-turn-context-replay branch from a22b112 to d843cf6 Compare May 1, 2026 04:26
@starr-openai starr-openai force-pushed the process-tools-stage2-turn-context-replay branch from d843cf6 to 97e1ace Compare May 1, 2026 04:33
@starr-openai starr-openai force-pushed the turncontext-env-stage1-combined branch from 4deeb8d to 5a0b31b Compare May 1, 2026 17:28
Base automatically changed from turncontext-env-stage1-combined to main May 1, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant