mirror of
https://github.com/openai/codex.git
synced 2026-11-03 00:21:31 +00:00
Centralize turn environment selection state (#38461)
## What changed - Store `TurnEnvironmentSelection` directly on each resolved `TurnEnvironment` instead of copying its environment ID, working directory, and workspace roots into separate fields. - Update environment resolution, tool execution, approvals, and related tests to access selection state through the retained value. GitOrigin-RevId: ab723d21e112b8af5bcaf1f772a5e376553312bc
This commit is contained in:
1 parent
18bbb585e7
commit
535795f7d1
31 files changed
+159
-146
No files matched your search
@@ -23,6 +23,7 @@ use codex_exec_server::RemoveOptions;
|
||||
use codex_extension_api::UserInstructions;
|
||||
use codex_features::Feature;
|
||||
use codex_protocol::models::PermissionProfile;
|
||||
use codex_protocol::protocol::TurnEnvironmentSelection;
|
||||
use codex_utils_absolute_path::AbsolutePathBuf;
|
||||
use codex_utils_path_uri::PathUri;
|
||||
use core_test_support::PathBufExt;
|
||||
@@ -332,13 +333,15 @@ fn resolved_local_environments<const N: usize>(
|
||||
.into_iter()
|
||||
.map(|(environment_id, cwd)| {
|
||||
TurnEnvironmentState::Ready(TurnEnvironment::new(
|
||||
environment_id.to_string(),
|
||||
TurnEnvironmentSelection {
|
||||
environment_id: environment_id.to_string(),
|
||||
cwd: PathUri::from_abs_path(&cwd),
|
||||
workspace_roots: Vec::new(),
|
||||
},
|
||||
Arc::new(
|
||||
Environment::create_for_tests(/*exec_server_url*/ None)
|
||||
.expect("local environment"),
|
||||
),
|
||||
PathUri::from_abs_path(&cwd),
|
||||
Vec::new(),
|
||||
/*shell*/ None,
|
||||
TurnEnvironmentConfig {
|
||||
allow_login_shell: true,
|
||||
|
||||
Reference in new issue
Block a user