Preserve session config when switching thread permission profiles (#45981)

## Why

Permission profile changes reloaded configuration without the thread's session overrides, so profiles defined at thread start could be unavailable to `thread/settings/update`.

## What changed

Reload permission configuration with the thread's merged, enabled `SessionFlags` layers, the effective working directory, and the requested profile. Preserve sandbox executable paths through `ConfigManager`.

## Testing

Add regression coverage for switching away from and back to session-defined and disk-defined profiles, including top-level profile selection. Add a config manager test for merging session layers, excluding disabled layers, and retaining filesystem access to the exec wrapper directory.

GitOrigin-RevId: b0271e28a90cd55d3faf5fdf5f044d768395b0b6
This commit is contained in:
Eric Traut
2026-09-16 16:46:34 +00:00
committed by copyberry
parent d7104e268b
commit 7b6dd0c7b8
5 changed files with 191 additions and 19 deletions
@@ -520,7 +520,6 @@ impl MessageProcessor {
Arc::clone(&thread_manager),
outgoing.clone(),
analytics_events_client.clone(),
arg0_paths.clone(),
Arc::clone(&config),
config_manager.clone(),
pending_thread_unloads,