tui: carry permission profiles on user turns (#18285)

## Why

Per-turn permission overrides should use the same canonical profile
abstraction as session configuration. That lets TUI submissions preserve
exact configured permissions without round-tripping through legacy
sandbox fields.

## What changed

This adds `permission_profile` to user-turn operations, threads it
through TUI/app-server submission paths, fills the new field in existing
test fixtures, and adds coverage that composer submission includes the
configured profile.

## Verification

- `cargo test -p codex-tui permissions -- --nocapture`
- `cargo test -p codex-core --test all permissions_messages --
--nocapture`























































---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/18285).
* #18288
* #18287
* #18286
* __->__ #18285
This commit is contained in:
Michael Bolin authored and GitHub committed 2026-04-23 11:54:17 -07:00
1 parent f11583b8f6
commit f90cc0ee64
45 files changed
+239 -10

No files matched your search

+2 -9
View File
@@ -497,6 +497,7 @@ impl App {
approval_policy,
approvals_reviewer,
sandbox_policy,
permission_profile,
model,
effort,
summary,
@@ -571,14 +572,6 @@ impl App {
}
}
if should_start_turn {
let permission_profile = if !app_server.is_remote()
&& self.runtime_sandbox_policy_override.is_some()
&& !matches!(sandbox_policy, SandboxPolicy::ExternalSandbox { .. })
{
Some(self.config.permissions.permission_profile())
} else {
None
};
app_server
.turn_start(
thread_id,
@@ -588,7 +581,7 @@ impl App {
approvals_reviewer
.unwrap_or(self.chat_widget.config_ref().approvals_reviewer),
sandbox_policy.clone(),
permission_profile,
permission_profile.clone(),
model.to_string(),
effort,
*summary,