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
+12
View File
@@ -3041,6 +3041,10 @@ pub enum ReviewDecision {
/// User has approved this command and the agent should execute it.
Approved,
/// User has approved this command and wants to execute a different argv
/// vector instead of the original one-time request.
ApprovedOverrideCommand { command: Vec<String> },
/// User has approved this command and wants to apply the proposed execpolicy
/// amendment so future matching commands are permitted.
ApprovedExecpolicyAmendment {
@@ -3069,11 +3073,19 @@ pub enum ReviewDecision {
}
impl ReviewDecision {
pub fn override_command(&self) -> Option<&[String]> {
match self {
ReviewDecision::ApprovedOverrideCommand { command } => Some(command.as_slice()),
_ => None,
}
}
/// Returns an opaque version of the decision without PII. We can't use an ignored flag
/// on `serde` because the serialization is required by some surfaces.
pub fn to_opaque_string(&self) -> &'static str {
match self {
ReviewDecision::Approved => "approved",
ReviewDecision::ApprovedOverrideCommand { .. } => "approved_with_command_override",
ReviewDecision::ApprovedExecpolicyAmendment { .. } => "approved_with_amendment",
ReviewDecision::ApprovedForSession => "approved_for_session",
ReviewDecision::NetworkPolicyAmendment {