chore(tui) cleanup /approvals (#10215)

## Summary
Consolidate on the new `/permissions` flow

## Testing
- [x] updated snapshots
This commit is contained in:
Dylan Hurd 2026-02-09 23:24:06 -08:00 committed by GitHub
parent 91704c5672
commit b61ea47e83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 18 additions and 27 deletions

View file

@ -3285,7 +3285,7 @@ impl ChatWidget {
self.app_event_tx.send(AppEvent::OpenAgentPicker);
}
SlashCommand::Approvals => {
self.open_approvals_popup();
self.open_permissions_popup();
}
SlashCommand::Permissions => {
self.open_permissions_popup();
@ -5207,18 +5207,14 @@ impl ChatWidget {
);
}
/// Open a popup to choose the approvals mode (ask for approval policy + sandbox policy).
/// Open the permissions popup (alias for /permissions).
pub(crate) fn open_approvals_popup(&mut self) {
self.open_approval_mode_popup(true);
self.open_permissions_popup();
}
/// Open a popup to choose the permissions mode (approval policy + sandbox policy).
pub(crate) fn open_permissions_popup(&mut self) {
let include_read_only = cfg!(target_os = "windows");
self.open_approval_mode_popup(include_read_only);
}
fn open_approval_mode_popup(&mut self, include_read_only: bool) {
let current_approval = self.config.approval_policy.value();
let current_sandbox = self.config.sandbox_policy.get();
let mut items: Vec<SelectionItem> = Vec::new();
@ -5247,7 +5243,7 @@ impl ChatWidget {
} else {
preset.label.to_string()
};
let description = Some(preset.description.to_string());
let description = Some(preset.description.replace(" (Identical to Agent mode)", ""));
let disabled_reason = match self.config.approval_policy.can_set(&preset.approval) {
Ok(()) => None,
Err(err) => Some(err.to_string()),
@ -5565,8 +5561,8 @@ impl ChatWidget {
// Build actions ensuring acknowledgement happens before applying the new sandbox policy,
// so downstream policy-change hooks don't re-trigger the warning.
let mut accept_actions: Vec<SelectionAction> = Vec::new();
// Suppress the immediate re-scan only when a preset will be applied (i.e., via /approvals),
// to avoid duplicate warnings from the ensuing policy change.
// Suppress the immediate re-scan only when a preset will be applied (i.e., via /approvals or
// /permissions), to avoid duplicate warnings from the ensuing policy change.
if preset.is_some() {
accept_actions.push(Box::new(|tx| {
tx.send(AppEvent::SkipNextWorldWritableScan);

View file

@ -1,18 +1,15 @@
---
source: tui/src/chatwidget/tests.rs
assertion_line: 3092
expression: popup
---
Update Model Permissions
1. Read Only (current) Codex can read files in the current workspace.
Approval is required to edit files or access the
internet.
2. Default Codex can read and edit files in the current
workspace, and run commands. Approval is required to
access the internet or edit other files. (Identical
to Agent mode)
3. Full Access Codex can edit files outside this workspace and
access the internet without asking for approval.
Exercise caution when using.
1. Default Codex can read and edit files in the current workspace, and
run commands. Approval is required to access the internet or
edit other files.
2. Full Access Codex can edit files outside this workspace and access the
internet without asking for approval. Exercise caution when
using.
Press enter to confirm or esc to go back

View file

@ -1,6 +1,6 @@
---
source: tui/src/chatwidget/tests.rs
assertion_line: 2654
assertion_line: 3925
expression: popup
---
Update Model Permissions
@ -10,8 +10,7 @@ expression: popup
internet.
2. Default Codex can read and edit files in the current
workspace, and run commands. Approval is required to
access the internet or edit other files. (Identical
to Agent mode)
access the internet or edit other files.
3. Full Access Codex can edit files outside this workspace and
access the internet without asking for approval.
Exercise caution when using.

View file

@ -1,6 +1,6 @@
---
source: tui/src/chatwidget/tests.rs
assertion_line: 2003
assertion_line: 3945
expression: popup
---
Update Model Permissions
@ -11,8 +11,7 @@ expression: popup
2. Default (non-elevated sandbox) Codex can read and edit files in the
current workspace, and run commands.
Approval is required to access the
internet or edit other files. (Identical
to Agent mode)
internet or edit other files.
3. Full Access Codex can edit files outside this
workspace and access the internet without
asking for approval. Exercise caution

View file

@ -75,7 +75,7 @@ impl SlashCommand {
SlashCommand::Plan => "switch to Plan mode",
SlashCommand::Collab => "change collaboration mode (experimental)",
SlashCommand::Agent => "switch the active agent thread",
SlashCommand::Approvals => "choose what Codex can do without approval",
SlashCommand::Approvals => "choose what Codex is allowed to do",
SlashCommand::Permissions => "choose what Codex is allowed to do",
SlashCommand::ElevateSandbox => "set up elevated agent sandbox",
SlashCommand::Experimental => "toggle experimental features",