Compare commits

...

2 Commits

Author SHA1 Message Date
Dylan Hurd
ff113dd3f5 clean up 2025-08-06 12:05:46 -07:00
Dylan Hurd
33a70d4169 [on-request] Update ApplyPatch handling 2025-08-06 11:51:08 -07:00

View File

@@ -5,6 +5,7 @@ use std::path::PathBuf;
use codex_apply_patch::ApplyPatchAction;
use codex_apply_patch::ApplyPatchFileChange;
use tracing::trace;
use crate::exec::SandboxType;
use crate::is_safe_command::is_known_safe_command;
@@ -31,9 +32,15 @@ pub fn assess_patch_safety(
}
match policy {
AskForApproval::OnFailure | AskForApproval::Never | AskForApproval::OnRequest => {
AskForApproval::OnFailure | AskForApproval::Never => {
// Continue to see if this can be auto-approved.
}
AskForApproval::OnRequest => {
// Delegate safety and approval handling to exec
return SafetyCheck::AutoApprove {
sandbox_type: get_platform_sandbox().unwrap_or(SandboxType::None),
};
}
// TODO(ragona): I'm not sure this is actually correct? I believe in this case
// we want to continue to the writable paths check before asking the user.
AskForApproval::UnlessTrusted => {