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:
sayan-oai authored and copyberry committed 2026-08-05 05:30:51 +00:00
1 parent 56b82e676c
commit 30d99232f4
15 files changed
+339 -116

No files matched your search

@@ -114,6 +114,11 @@ async fn shell_command_handler_to_exec_params_uses_selected_environment() {
Some(selected_shell),
EnvironmentConfig {
allow_login_shell: true,
permission_profile: turn_context
.config
.permissions
.permission_profile_state()
.snapshot(),
},
);
let mut expected_env = create_env(