mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +00:00
Use root evidence in Guardian reviews for hosted agents (#63742)
## Why Guardian could resolve root instructions for locally managed agents through the agent tree. Detached workers need their host to supply that evidence so Guardian can evaluate their actions against the root user's instructions. ## What changed - Let trusted hosts capture reusable root evidence, watch for committed changes, and select handoff context for each worker. Supply that evidence to Guardian while keeping it out of the worker's conversation. - Bound hosted evidence reads by the review deadline and cancellation. Recheck root evidence before approving, and invalidate cached authorization when the root runtime is replaced. - Let a cached score end a pending review only when it covers the action under review and its worker and root evidence revisions still match. ## Testing Add coverage for hosted reviews that receive root instructions, unavailable and stalled evidence reads, root replacement, and delayed scores for an earlier tool call. GitOrigin-RevId: 52553041ef449a2e180f9f1b7fc261dcbcb76f01
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use codex_guardian_context::CachedApprovalContext;
|
||||
use codex_protocol::ThreadId;
|
||||
|
||||
use crate::ExtensionData;
|
||||
@@ -26,7 +27,7 @@ pub trait SynchronousApprovalReviewer: Send + Sync {
|
||||
fn review<'a>(
|
||||
&'a self,
|
||||
reason: codex_protocol::approvals::GuardianReviewReason,
|
||||
async_approval: Option<crate::ExtensionFuture<'a, ()>>,
|
||||
async_approval: Option<crate::ExtensionFuture<'a, CachedApprovalContext>>,
|
||||
) -> crate::ExtensionFuture<'a, Option<codex_protocol::protocol::ReviewDecision>>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user