mirror of
https://github.com/openai/codex.git
synced 2026-11-13 22:47:20 +00:00
Remove legacy Guardian approval review paths (#43462)
## What changed - Remove the `fast_decision` and `full_review` extension hooks and `ApprovalAssessment`, leaving `ApprovalReviewContributor::decide` as the approval decision interface. - Remove the duplicate Guardian V2 fast-approval implementation and `StrictReviewReason` state. - Require an explicit `GuardianReviewReason` for synchronous reviews. ## Testing Migrate Guardian reviewer tests to the production `decide_approval` path and cached-score tests to the registry's decision interface. GitOrigin-RevId: 1f9092c0ff5bb1eed0c63fa557fb3807e2e71564
This commit is contained in:
1 parent
8260619cb6
commit
db0568dbbb
14 files changed
+342
-968
No files matched your search
@@ -1,16 +1,9 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use codex_protocol::protocol::ReviewDecision;
|
||||
|
||||
use crate::ApprovalAssessment;
|
||||
use crate::ApprovalReviewContributor;
|
||||
use crate::ApprovalReviewError;
|
||||
use crate::ApprovalReviewInput;
|
||||
use crate::ConfigContributor;
|
||||
use crate::ContextContributor;
|
||||
use crate::ExtensionData;
|
||||
use crate::ExtensionEventSink;
|
||||
use crate::ExtensionMetrics;
|
||||
use crate::McpServerContributor;
|
||||
use crate::NoopExtensionEventSink;
|
||||
use crate::SkillInvocationContributor;
|
||||
@@ -202,45 +195,6 @@ impl<C: Sync> ExtensionRegistry<C> {
|
||||
.any(|contributor| contributor.requires_host_skill_discovery())
|
||||
}
|
||||
|
||||
/// Returns the first full approval assessment claimed by a contributor.
|
||||
pub async fn full_approval_review(
|
||||
&self,
|
||||
input: ApprovalReviewInput<'_>,
|
||||
) -> Option<Result<ApprovalAssessment, ApprovalReviewError>> {
|
||||
for contributor in &self.approval_review_contributors {
|
||||
if let Some(assessment) = contributor.full_review(&input).await {
|
||||
return Some(assessment);
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
/// Returns the first fast approval decision claimed by a contributor.
|
||||
pub async fn fast_approval_decision(
|
||||
&self,
|
||||
session_store: &ExtensionData,
|
||||
thread_store: &ExtensionData,
|
||||
prompt: &str,
|
||||
extension_metrics: Option<Arc<dyn ExtensionMetrics>>,
|
||||
) -> Option<ReviewDecision> {
|
||||
for contributor in &self.approval_review_contributors {
|
||||
if let Some(decision) = contributor
|
||||
.fast_decision(
|
||||
session_store,
|
||||
thread_store,
|
||||
prompt,
|
||||
extension_metrics.clone(),
|
||||
)
|
||||
.await
|
||||
{
|
||||
return Some(decision);
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
/// Returns the first claimed decision in registration order.
|
||||
pub async fn decide_approval(
|
||||
&self,
|
||||
|
||||
Reference in new issue
Block a user