Count Guardian denial-limit interruptions in telemetry (#51334)

## What changed

Increment `codex.guardian.denial_limit_reached` when automatic approval review reaches a turn's denial limit, immediately before interrupting the turn. Record the counter once per turn, matching the denial warning's existing behavior.

GitOrigin-RevId: ec8eeeff6a681a261572496e59cf694e87e813ce
This commit is contained in:
jif
2026-10-06 10:50:06 +00:00
committed by copyberry
parent 5ddd19e8a9
commit 79cae5f7fb
@@ -141,6 +141,12 @@ impl<H: ReviewHost> SynchronousApprovalReviewer for ReviewRequest<'_, H> {
let denials = ReviewDenials::for_thread(self.thread_store);
if completed.assessment_outcome == Some(GuardianAssessmentOutcome::Deny) {
if let Some(message) = denials.record_denial(&turn_id, &model).await {
// The denial window returns a warning only once per turn.
self.telemetry.counter(
"codex.guardian.denial_limit_reached",
/*inc*/ 1,
&[],
);
self.host
.interrupt(
&turn_id,