Fix sandbox retry approvals

This commit is contained in:
Tiffany Citra
2025-10-15 17:04:10 -07:00
parent 6e7d4a4b45
commit 980778f529

View File

@@ -982,13 +982,17 @@ async fn handle_function_call(
)
.await;
match rx_approve.await.unwrap_or_default() {
let decision = rx_approve.await.unwrap_or_default();
if matches!(decision, ReviewDecision::ApprovedForSession) {
// Persist this command as pre-approved for the
// remainder of the session so future executions
// can skip the sandbox directly.
sess.add_approved_command(params.command.clone());
}
match decision {
ReviewDecision::Approved | ReviewDecision::ApprovedForSession => {
// Persist this command as preapproved for the
// remainder of the session so future
// executions skip the sandbox directly.
// TODO(ragona): Isn't this a bug? It always saves the command in an | fork?
sess.add_approved_command(params.command.clone());
// Inform UI we are retrying without sandbox.
sess.notify_background_event(
&sub_id,