mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Apply permission profile updates to future turn environments (#37031)
## What changed - Include the current permission profile in each turn environment's configuration. - Refresh retained environment configurations when session settings change, while preserving the configuration already captured by active turns. - Keep environment connection and shell snapshot resolution reusable across configuration updates. ## Testing - Cover permission profile updates applied through both session settings updates and per-turn updates. - Verify that pending environment resolutions use the configuration captured by their turn and that configuration-only updates do not retry failed environments. GitOrigin-RevId: 923694f0729b87a118d7635ade3a8ca9bcd4e7b1
This commit is contained in:
1 parent
56b82e676c
commit
30d99232f4
15 files changed
+339
-116
No files matched your search
@@ -217,7 +217,6 @@ mod tests {
|
||||
use super::*;
|
||||
use crate::environment_selection::TurnEnvironmentState;
|
||||
use crate::session::tests::make_session_and_context;
|
||||
use crate::session::turn_context::EnvironmentConfig;
|
||||
use crate::session::turn_context::TurnContext;
|
||||
use crate::session::turn_context::TurnEnvironment;
|
||||
use codex_utils_absolute_path::AbsolutePathBuf;
|
||||
@@ -316,22 +315,21 @@ mod tests {
|
||||
.await
|
||||
.expect("write local file");
|
||||
set_primary_environment_cwd(&mut turn_context, dir.path());
|
||||
let selection = turn_context
|
||||
let environment = turn_context
|
||||
.environments
|
||||
.primary()
|
||||
.expect("ready primary environment")
|
||||
.selection();
|
||||
.expect("ready primary environment");
|
||||
let selection = environment.selection();
|
||||
let environment_config = environment.config.clone();
|
||||
let environments = crate::environment_selection::ThreadEnvironments::new(
|
||||
session.services.turn_environments.environment_manager(),
|
||||
crate::shell::default_user_shell(),
|
||||
EnvironmentConfig {
|
||||
allow_login_shell: turn_context.config.permissions.allow_login_shell,
|
||||
},
|
||||
environment_config.clone(),
|
||||
crate::shell_snapshot::ShellSnapshot::disabled(),
|
||||
Default::default(),
|
||||
/*non_blocking_snapshots*/ true,
|
||||
);
|
||||
environments.update_selections(std::slice::from_ref(&selection));
|
||||
environments.update_selections(std::slice::from_ref(&selection), &environment_config);
|
||||
turn_context.environments = environments.snapshot().await;
|
||||
turn_context
|
||||
.environments
|
||||
|
||||
Reference in new issue
Block a user