mirror of
https://github.com/openai/codex.git
synced 2026-04-24 06:35:50 +00:00
Drop permission policy changes from context fragment PR
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -214,13 +214,12 @@ pub(super) async fn apply_granted_turn_permissions(
|
||||
_ => false,
|
||||
};
|
||||
|
||||
let sandbox_permissions = if effective_permissions.is_some()
|
||||
&& !sandbox_permissions.requires_additional_permissions()
|
||||
{
|
||||
SandboxPermissions::WithAdditionalPermissions
|
||||
} else {
|
||||
sandbox_permissions
|
||||
};
|
||||
let sandbox_permissions =
|
||||
if effective_permissions.is_some() && !sandbox_permissions.uses_additional_permissions() {
|
||||
SandboxPermissions::WithAdditionalPermissions
|
||||
} else {
|
||||
sandbox_permissions
|
||||
};
|
||||
|
||||
EffectiveAdditionalPermissions {
|
||||
sandbox_permissions,
|
||||
|
||||
@@ -381,7 +381,7 @@ impl ShellHandler {
|
||||
// continue through the normal exec approval flow for the command.
|
||||
if effective_additional_permissions
|
||||
.sandbox_permissions
|
||||
.requires_escalated_permissions()
|
||||
.requests_sandbox_override()
|
||||
&& !effective_additional_permissions.permissions_preapproved
|
||||
&& !matches!(
|
||||
turn.approval_policy.value(),
|
||||
|
||||
@@ -187,7 +187,7 @@ impl ToolHandler for UnifiedExecHandler {
|
||||
// continue through the normal exec approval flow for the command.
|
||||
if effective_additional_permissions
|
||||
.sandbox_permissions
|
||||
.requires_escalated_permissions()
|
||||
.requests_sandbox_override()
|
||||
&& !effective_additional_permissions.permissions_preapproved
|
||||
&& !matches!(
|
||||
context.turn.approval_policy.value(),
|
||||
|
||||
@@ -239,7 +239,7 @@ fn shell_event_with_prefix_rule(
|
||||
"command": command,
|
||||
"timeout_ms": timeout_ms,
|
||||
});
|
||||
if sandbox_permissions.requires_escalated_permissions() {
|
||||
if sandbox_permissions.requests_sandbox_override() {
|
||||
args["sandbox_permissions"] = json!(sandbox_permissions);
|
||||
}
|
||||
if let Some(prefix_rule) = prefix_rule {
|
||||
@@ -262,7 +262,7 @@ fn exec_command_event(
|
||||
if let Some(yield_time_ms) = yield_time_ms {
|
||||
args["yield_time_ms"] = json!(yield_time_ms);
|
||||
}
|
||||
if sandbox_permissions.requires_escalated_permissions() {
|
||||
if sandbox_permissions.requests_sandbox_override() {
|
||||
args["sandbox_permissions"] = json!(sandbox_permissions);
|
||||
let reason = justification.unwrap_or(DEFAULT_UNIFIED_EXEC_JUSTIFICATION);
|
||||
args["justification"] = json!(reason);
|
||||
|
||||
Reference in New Issue
Block a user