mirror of
https://github.com/openai/codex.git
synced 2026-04-28 02:11:08 +03:00
condition
This commit is contained in:
@@ -384,24 +384,26 @@ impl BottomPane {
|
||||
|
||||
/// Called when the agent requests user approval.
|
||||
pub fn push_approval_request(&mut self, request: ApprovalRequest) {
|
||||
// Send a system notification whenever an approval dialog is about to be shown.
|
||||
match &request {
|
||||
ApprovalRequest::Exec { command, .. } => {
|
||||
let preview = command.join(" ");
|
||||
let msg = format!("Approve \"{preview}\"?");
|
||||
notifications::send_os_notification(&msg);
|
||||
}
|
||||
ApprovalRequest::ApplyPatch {
|
||||
reason, grant_root, ..
|
||||
} => {
|
||||
let msg = if let Some(root) = grant_root {
|
||||
format!("Approve patch changes? Grant write to {}", root.display())
|
||||
} else if let Some(r) = reason {
|
||||
format!("Approve patch changes? {r}")
|
||||
} else {
|
||||
"Approve patch changes?".to_string()
|
||||
};
|
||||
notifications::send_os_notification(&msg);
|
||||
if !self.has_input_focus {
|
||||
// Send a system notification whenever an approval dialog is about to be shown.
|
||||
match &request {
|
||||
ApprovalRequest::Exec { command, .. } => {
|
||||
let preview = command.join(" ");
|
||||
let msg = format!("Approve \"{preview}\"?");
|
||||
notifications::send_os_notification(&msg);
|
||||
}
|
||||
ApprovalRequest::ApplyPatch {
|
||||
reason, grant_root, ..
|
||||
} => {
|
||||
let msg = if let Some(root) = grant_root {
|
||||
format!("Approve patch changes? Grant write to {}", root.display())
|
||||
} else if let Some(r) = reason {
|
||||
format!("Approve patch changes? {r}")
|
||||
} else {
|
||||
"Approve patch changes?".to_string()
|
||||
};
|
||||
notifications::send_os_notification(&msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user