Clean up permission request approval flow

Replace stringly approval-attempt plumbing with a shared enum, centralize approval decision handling in the orchestrator, and document plus test the reserved PermissionRequest output fields.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Abhinav Vedmala
2026-04-12 14:00:54 -07:00
co-authored by Codex
parent 86282db6c1
commit 1bf5222fbb
8 changed files with 179 additions and 87 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
use std::future::Future;
use std::sync::Arc;
use codex_hooks::PermissionRequestApprovalAttempt;
use codex_hooks::PermissionRequestDecision;
use codex_hooks::PermissionRequestOutcome;
use codex_hooks::PermissionRequestRequest;
@@ -158,7 +159,7 @@ pub(crate) async fn run_permission_request_hooks(
turn_context: &Arc<TurnContext>,
run_id_suffix: String,
payload: PermissionRequestPayload,
approval_attempt: String,
approval_attempt: PermissionRequestApprovalAttempt,
retry_reason: Option<String>,
network_approval_context: Option<NetworkApprovalContext>,
) -> Option<PermissionRequestDecision> {