chore(core) rm AskForApproval::OnFailure (#28418)

## Summary
Deletes the OnFailure variant of the `AskForApproval` enum. This option
has been deprecated since #11631.

## Testing
- [x] Tests pass
This commit is contained in:
Dylan Hurd
2026-06-23 12:13:54 -07:00
committed by GitHub
Unverified
parent e476fc16ce
commit 2cf2a6a844
56 changed files with 75 additions and 479 deletions
+15 -8
View File
@@ -870,15 +870,8 @@ pub enum AskForApproval {
#[strum(serialize = "untrusted")]
UnlessTrusted,
/// DEPRECATED: *All* commands are autoapproved, but they are expected to
/// run inside a sandbox where network access is disabled and writes are
/// confined to a specific set of paths. If the command fails, it will be
/// escalated to the user to approve execution without a sandbox.
/// Prefer `OnRequest` for interactive runs or `Never` for non-interactive
/// runs.
OnFailure,
/// The model decides when to ask the user for approval.
#[serde(alias = "on-failure")]
#[default]
OnRequest,
@@ -5439,6 +5432,20 @@ mod tests {
Ok(())
}
#[test]
fn turn_context_item_deserializes_legacy_on_failure_as_on_request() -> Result<()> {
let item: TurnContextItem = serde_json::from_value(json!({
"cwd": test_path_buf("/tmp"),
"approval_policy": "on-failure",
"sandbox_policy": { "type": "danger-full-access" },
"model": "gpt-5",
"summary": "auto",
}))?;
assert_eq!(item.approval_policy, AskForApproval::OnRequest);
Ok(())
}
#[test]
fn multi_agent_version_uses_newest_present_session_meta_value() -> Result<()> {
let thread_id = ThreadId::from_string("67e55044-10b1-426f-9247-bb680e5fe0c8")?;