Skip to main content

check_approval_with_tty_timeout

Function check_approval_with_tty_timeout 

Source
pub async fn check_approval_with_tty_timeout(
    module_def: &Value,
    auto_approve: bool,
    is_tty: bool,
    timeout_secs: u64,
) -> Result<(), ApprovalError>
Expand description

Testable gate that honors a configurable timeout.

Decision order:

  1. Skip entirely if requires_approval is not strict bool true.
  2. Bypass if auto_approve == true (–yes flag).
  3. Bypass if APCORE_CLI_AUTO_APPROVE == "1" (exact match).
  4. Reject if !is_tty (NonInteractive).
  5. Prompt interactively with timeout_secs timeout.