Add parent-scoped guardian approval review events

Emit experimental item-scoped guardian approval review notifications for command execution, file change, and MCP tool call items while keeping the legacy autoApprovalReview notifications as deprecated aliases. Update the app-server docs and generated protocol schema fixtures.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Charles Cunningham
2026-03-20 17:46:24 -07:00
co-authored by Codex
parent 7754dd1b89
commit bb2427564f
26 changed files with 1875 additions and 69 deletions
@@ -889,7 +889,35 @@ server_notification_definitions! {
TurnDiffUpdated => "turn/diff/updated" (v2::TurnDiffUpdatedNotification),
TurnPlanUpdated => "turn/plan/updated" (v2::TurnPlanUpdatedNotification),
ItemStarted => "item/started" (v2::ItemStartedNotification),
#[experimental("item/commandExecution/guardianApprovalReview/started")]
CommandExecutionGuardianApprovalReviewStarted =>
"item/commandExecution/guardianApprovalReview/started"
(v2::CommandExecutionGuardianApprovalReviewStartedNotification),
#[experimental("item/commandExecution/guardianApprovalReview/completed")]
CommandExecutionGuardianApprovalReviewCompleted =>
"item/commandExecution/guardianApprovalReview/completed"
(v2::CommandExecutionGuardianApprovalReviewCompletedNotification),
#[experimental("item/fileChange/guardianApprovalReview/started")]
FileChangeGuardianApprovalReviewStarted =>
"item/fileChange/guardianApprovalReview/started"
(v2::FileChangeGuardianApprovalReviewStartedNotification),
#[experimental("item/fileChange/guardianApprovalReview/completed")]
FileChangeGuardianApprovalReviewCompleted =>
"item/fileChange/guardianApprovalReview/completed"
(v2::FileChangeGuardianApprovalReviewCompletedNotification),
#[experimental("item/mcpToolCall/guardianApprovalReview/started")]
McpToolCallGuardianApprovalReviewStarted =>
"item/mcpToolCall/guardianApprovalReview/started"
(v2::McpToolCallGuardianApprovalReviewStartedNotification),
#[experimental("item/mcpToolCall/guardianApprovalReview/completed")]
McpToolCallGuardianApprovalReviewCompleted =>
"item/mcpToolCall/guardianApprovalReview/completed"
(v2::McpToolCallGuardianApprovalReviewCompletedNotification),
/// Deprecated: Use the parent item-specific
/// `item/*/guardianApprovalReview/*` notifications instead.
ItemGuardianApprovalReviewStarted => "item/autoApprovalReview/started" (v2::ItemGuardianApprovalReviewStartedNotification),
/// Deprecated: Use the parent item-specific
/// `item/*/guardianApprovalReview/*` notifications instead.
ItemGuardianApprovalReviewCompleted => "item/autoApprovalReview/completed" (v2::ItemGuardianApprovalReviewCompletedNotification),
ItemCompleted => "item/completed" (v2::ItemCompletedNotification),
/// This event is internal-only. Used by Codex Cloud.
@@ -4344,9 +4344,8 @@ impl From<CoreGuardianRiskLevel> for GuardianRiskLevel {
}
}
/// [UNSTABLE] Temporary guardian approval review payload used by
/// `item/autoApprovalReview/*` notifications. This shape is expected to change
/// soon.
/// [UNSTABLE] Temporary guardian approval review payload used by guardian
/// approval review notifications. This shape is expected to change soon.
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
@@ -4829,6 +4828,87 @@ pub struct ItemStartedNotification {
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
/// [UNSTABLE] Temporary notification payload for guardian approval review on a
/// command execution item. This shape is expected to change soon.
pub struct CommandExecutionGuardianApprovalReviewStartedNotification {
pub thread_id: String,
pub turn_id: String,
pub item_id: String,
pub review: GuardianApprovalReview,
pub action: Option<JsonValue>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
/// [UNSTABLE] Temporary notification payload for guardian approval review on a
/// command execution item. This shape is expected to change soon.
pub struct CommandExecutionGuardianApprovalReviewCompletedNotification {
pub thread_id: String,
pub turn_id: String,
pub item_id: String,
pub review: GuardianApprovalReview,
pub action: Option<JsonValue>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
/// [UNSTABLE] Temporary notification payload for guardian approval review on a
/// file change item. This shape is expected to change soon.
pub struct FileChangeGuardianApprovalReviewStartedNotification {
pub thread_id: String,
pub turn_id: String,
pub item_id: String,
pub review: GuardianApprovalReview,
pub action: Option<JsonValue>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
/// [UNSTABLE] Temporary notification payload for guardian approval review on a
/// file change item. This shape is expected to change soon.
pub struct FileChangeGuardianApprovalReviewCompletedNotification {
pub thread_id: String,
pub turn_id: String,
pub item_id: String,
pub review: GuardianApprovalReview,
pub action: Option<JsonValue>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
/// [UNSTABLE] Temporary notification payload for guardian approval review on
/// an MCP tool call item. This shape is expected to change soon.
pub struct McpToolCallGuardianApprovalReviewStartedNotification {
pub thread_id: String,
pub turn_id: String,
pub item_id: String,
pub review: GuardianApprovalReview,
pub action: Option<JsonValue>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
/// [UNSTABLE] Temporary notification payload for guardian approval review on
/// an MCP tool call item. This shape is expected to change soon.
pub struct McpToolCallGuardianApprovalReviewCompletedNotification {
pub thread_id: String,
pub turn_id: String,
pub item_id: String,
pub review: GuardianApprovalReview,
pub action: Option<JsonValue>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
/// Deprecated: Use the parent item-specific
/// `item/*/guardianApprovalReview/*` notifications instead.
///
/// [UNSTABLE] Temporary notification payload for guardian automatic approval
/// review. This shape is expected to change soon.
///
@@ -4846,6 +4926,9 @@ pub struct ItemGuardianApprovalReviewStartedNotification {
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
/// Deprecated: Use the parent item-specific
/// `item/*/guardianApprovalReview/*` notifications instead.
///
/// [UNSTABLE] Temporary notification payload for guardian automatic approval
/// review. This shape is expected to change soon.
///