Add a slash command to control permissions (#2474)

A slash command to control permissions



https://github.com/user-attachments/assets/c0edafcd-2085-4e09-8009-ba69c4f1c153

---------

Co-authored-by: ae <ae@openai.com>
This commit is contained in:
Ahmed Ibrahim
2025-08-19 22:34:37 -07:00
committed by GitHub
parent ce434b1219
commit 202af12926
8 changed files with 142 additions and 3 deletions

View File

@@ -387,6 +387,11 @@ impl App<'_> {
widget.open_model_popup();
}
}
SlashCommand::Approvals => {
if let AppState::Chat { widget } = &mut self.app_state {
widget.open_approvals_popup();
}
}
SlashCommand::Quit => {
break;
}
@@ -514,6 +519,16 @@ impl App<'_> {
widget.set_model(model);
}
}
AppEvent::UpdateAskForApprovalPolicy(policy) => {
if let AppState::Chat { widget } = &mut self.app_state {
widget.set_approval_policy(policy);
}
}
AppEvent::UpdateSandboxPolicy(policy) => {
if let AppState::Chat { widget } = &mut self.app_state {
widget.set_sandbox_policy(policy);
}
}
}
}
terminal.clear()?;