Preserve restored permission profiles in TUI sessions (#41192)

## Why

Restored app-server threads can carry permission profiles that cannot be
represented without loss as legacy sandbox-mode overrides. Sending those
profiles as per-turn overrides can discard their original permission details.

## What changed

- Distinguish restored permission profiles from legacy per-turn sandbox
  overrides.
- Preserve restored profiles while routing turns and changing to compatible
  working directories.
- Reject `/cd` when a restored profile cannot be represented safely by a
  legacy sandbox mode.

## Testing

- Cover retaining a restored read-only profile across `/cd` without a turn
  override.
- Verify that lossy sandbox-mode projections are detected.

GitOrigin-RevId: 6143dca4b83ab4f59bab05f6a59b4fe841c56192
This commit is contained in:
Eric Traut authored and copyberry committed 2026-08-27 19:51:10 +00:00
1 parent 8935ff19db
commit c29bc99949
9 files changed
+167 -12

No files matched your search

+1 -1
View File
@@ -739,7 +739,7 @@ impl App {
active_permission_profile.as_ref(),
self.runtime_permission_profile_override
.as_ref()
.map(|profile| &profile.permission_profile),
.and_then(RuntimePermissionProfileOverride::turn_permission_profile),
);
let response = app_server
.turn_start(