diff --git a/codex-rs/core/src/codex_tests.rs b/codex-rs/core/src/codex_tests.rs index 46122b953d..0f6c71f299 100644 --- a/codex-rs/core/src/codex_tests.rs +++ b/codex-rs/core/src/codex_tests.rs @@ -4638,7 +4638,10 @@ async fn tool_call_metadata_stamps_policy_source_without_review_decision_when_fe sess.record_call_approval_outcome( "call-policy-runtime-1".to_string(), - ApprovalOutcomeMetadata::policy(), + ApprovalOutcomeMetadata { + review_decision: None, + approval_source: codex_protocol::models::ApprovalSourceMetadata::Policy, + }, ) .await; sess.record_response_item_and_emit_turn_item( @@ -5070,8 +5073,8 @@ async fn prepend_pending_input_keeps_older_tail_ahead_of_newer_input() { .map(|(input, metadata)| crate::state::PendingInputItem { input, metadata }) .collect(), ) - .await - .expect("requeue later pending input at the front of the queue"); + .await + .expect("requeue later pending input at the front of the queue"); assert_eq!( sess.get_pending_input_with_metadata().await, diff --git a/codex-rs/core/src/state/turn.rs b/codex-rs/core/src/state/turn.rs index 7d4d4eb9c4..e482924cef 100644 --- a/codex-rs/core/src/state/turn.rs +++ b/codex-rs/core/src/state/turn.rs @@ -107,13 +107,6 @@ impl ApprovalOutcomeMetadata { approval_source, } } - - pub(crate) fn policy() -> Self { - Self { - review_decision: None, - approval_source: ApprovalSourceMetadata::Policy, - } - } } impl ActiveTurn { diff --git a/codex-rs/core/src/tools/runtimes/shell/unix_escalation.rs b/codex-rs/core/src/tools/runtimes/shell/unix_escalation.rs index db1de9a596..e0e5a90e31 100644 --- a/codex-rs/core/src/tools/runtimes/shell/unix_escalation.rs +++ b/codex-rs/core/src/tools/runtimes/shell/unix_escalation.rs @@ -535,7 +535,10 @@ impl CoreShellActionProvider { self.session .record_call_approval_outcome( self.call_id.clone(), - ApprovalOutcomeMetadata::policy(), + ApprovalOutcomeMetadata { + review_decision: None, + approval_source: codex_protocol::models::ApprovalSourceMetadata::Policy, + }, ) .await; EscalationDecision::deny(Some("Execution forbidden by policy".to_string())) @@ -547,7 +550,10 @@ impl CoreShellActionProvider { self.session .record_call_approval_outcome( self.call_id.clone(), - ApprovalOutcomeMetadata::policy(), + ApprovalOutcomeMetadata { + review_decision: None, + approval_source: codex_protocol::models::ApprovalSourceMetadata::Policy, + }, ) .await; EscalationDecision::deny(Some("Execution forbidden by policy".to_string()))