Add AcceptWithOverrideCommand for approval decision

This commit is contained in:
Qiyao Qin
2026-03-13 00:19:41 -07:00
parent 76d8d174b1
commit 671cc4644b
22 changed files with 272 additions and 9 deletions
@@ -2429,6 +2429,19 @@ async fn on_command_execution_request_approval_response(
let (decision, completion_status) = match decision {
CommandExecutionApprovalDecision::Accept => (ReviewDecision::Approved, None),
CommandExecutionApprovalDecision::AcceptWithOverrideCommand { command } => {
if command.is_empty() {
error!(
"failed to deserialize CommandExecutionRequestApprovalResponse: override command cannot be empty"
);
(
ReviewDecision::Denied,
Some(CommandExecutionStatus::Declined),
)
} else {
(ReviewDecision::ApprovedOverrideCommand { command }, None)
}
}
CommandExecutionApprovalDecision::AcceptForSession => {
(ReviewDecision::ApprovedForSession, None)
}