mirror of
https://github.com/openai/codex.git
synced 2026-11-14 21:40:39 +00:00
Add guardian review client overrides
This commit is contained in:
@@ -987,6 +987,14 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"GuardianApprovalReviewOverrideDecision": {
|
||||
"description": "[UNSTABLE] Client decision that preempts a pending guardian approval review.",
|
||||
"enum": [
|
||||
"approve",
|
||||
"decline"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ImageDetail": {
|
||||
"enum": [
|
||||
"auto",
|
||||
@@ -1038,6 +1046,30 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ItemGuardianApprovalReviewOverrideParams": {
|
||||
"description": "[UNSTABLE] Params for preempting a pending guardian approval review.",
|
||||
"properties": {
|
||||
"decision": {
|
||||
"$ref": "#/definitions/GuardianApprovalReviewOverrideDecision"
|
||||
},
|
||||
"reviewId": {
|
||||
"type": "string"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
},
|
||||
"turnId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"decision",
|
||||
"reviewId",
|
||||
"threadId",
|
||||
"turnId"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ListMcpServerStatusParams": {
|
||||
"properties": {
|
||||
"cursor": {
|
||||
@@ -4402,6 +4434,30 @@
|
||||
"title": "Review/startRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"item/autoApprovalReview/override"
|
||||
],
|
||||
"title": "Item/autoApprovalReview/overrideRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/ItemGuardianApprovalReviewOverrideParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "Item/autoApprovalReview/overrideRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
|
||||
@@ -391,7 +391,8 @@
|
||||
"AutoReviewDecisionSource": {
|
||||
"description": "[UNSTABLE] Source that produced a terminal guardian approval review decision.",
|
||||
"enum": [
|
||||
"agent"
|
||||
"agent",
|
||||
"user"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
@@ -1058,6 +1058,30 @@
|
||||
"title": "Review/startRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/v2/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"item/autoApprovalReview/override"
|
||||
],
|
||||
"title": "Item/autoApprovalReview/overrideRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/v2/ItemGuardianApprovalReviewOverrideParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "Item/autoApprovalReview/overrideRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
@@ -5539,7 +5563,8 @@
|
||||
"AutoReviewDecisionSource": {
|
||||
"description": "[UNSTABLE] Source that produced a terminal guardian approval review decision.",
|
||||
"enum": [
|
||||
"agent"
|
||||
"agent",
|
||||
"user"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
@@ -8291,6 +8316,14 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"GuardianApprovalReviewOverrideDecision": {
|
||||
"description": "[UNSTABLE] Client decision that preempts a pending guardian approval review.",
|
||||
"enum": [
|
||||
"approve",
|
||||
"decline"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"GuardianApprovalReviewStatus": {
|
||||
"description": "[UNSTABLE] Lifecycle state for a guardian approval review.",
|
||||
"enum": [
|
||||
@@ -8619,6 +8652,38 @@
|
||||
"title": "ItemGuardianApprovalReviewCompletedNotification",
|
||||
"type": "object"
|
||||
},
|
||||
"ItemGuardianApprovalReviewOverrideParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "[UNSTABLE] Params for preempting a pending guardian approval review.",
|
||||
"properties": {
|
||||
"decision": {
|
||||
"$ref": "#/definitions/v2/GuardianApprovalReviewOverrideDecision"
|
||||
},
|
||||
"reviewId": {
|
||||
"type": "string"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
},
|
||||
"turnId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"decision",
|
||||
"reviewId",
|
||||
"threadId",
|
||||
"turnId"
|
||||
],
|
||||
"title": "ItemGuardianApprovalReviewOverrideParams",
|
||||
"type": "object"
|
||||
},
|
||||
"ItemGuardianApprovalReviewOverrideResponse": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "[UNSTABLE] Empty response for `item/autoApprovalReview/override`.",
|
||||
"title": "ItemGuardianApprovalReviewOverrideResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ItemGuardianApprovalReviewStartedNotification": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "[UNSTABLE] Temporary notification payload for guardian automatic approval review. This shape is expected to change soon.",
|
||||
|
||||
@@ -718,7 +718,8 @@
|
||||
"AutoReviewDecisionSource": {
|
||||
"description": "[UNSTABLE] Source that produced a terminal guardian approval review decision.",
|
||||
"enum": [
|
||||
"agent"
|
||||
"agent",
|
||||
"user"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
@@ -1640,6 +1641,30 @@
|
||||
"title": "Review/startRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"item/autoApprovalReview/override"
|
||||
],
|
||||
"title": "Item/autoApprovalReview/overrideRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/ItemGuardianApprovalReviewOverrideParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "Item/autoApprovalReview/overrideRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
@@ -5050,6 +5075,14 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"GuardianApprovalReviewOverrideDecision": {
|
||||
"description": "[UNSTABLE] Client decision that preempts a pending guardian approval review.",
|
||||
"enum": [
|
||||
"approve",
|
||||
"decline"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"GuardianApprovalReviewStatus": {
|
||||
"description": "[UNSTABLE] Lifecycle state for a guardian approval review.",
|
||||
"enum": [
|
||||
@@ -5422,6 +5455,38 @@
|
||||
"title": "ItemGuardianApprovalReviewCompletedNotification",
|
||||
"type": "object"
|
||||
},
|
||||
"ItemGuardianApprovalReviewOverrideParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "[UNSTABLE] Params for preempting a pending guardian approval review.",
|
||||
"properties": {
|
||||
"decision": {
|
||||
"$ref": "#/definitions/GuardianApprovalReviewOverrideDecision"
|
||||
},
|
||||
"reviewId": {
|
||||
"type": "string"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
},
|
||||
"turnId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"decision",
|
||||
"reviewId",
|
||||
"threadId",
|
||||
"turnId"
|
||||
],
|
||||
"title": "ItemGuardianApprovalReviewOverrideParams",
|
||||
"type": "object"
|
||||
},
|
||||
"ItemGuardianApprovalReviewOverrideResponse": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "[UNSTABLE] Empty response for `item/autoApprovalReview/override`.",
|
||||
"title": "ItemGuardianApprovalReviewOverrideResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ItemGuardianApprovalReviewStartedNotification": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "[UNSTABLE] Temporary notification payload for guardian automatic approval review. This shape is expected to change soon.",
|
||||
|
||||
+2
-1
@@ -4,7 +4,8 @@
|
||||
"AutoReviewDecisionSource": {
|
||||
"description": "[UNSTABLE] Source that produced a terminal guardian approval review decision.",
|
||||
"enum": [
|
||||
"agent"
|
||||
"agent",
|
||||
"user"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"definitions": {
|
||||
"GuardianApprovalReviewOverrideDecision": {
|
||||
"description": "[UNSTABLE] Client decision that preempts a pending guardian approval review.",
|
||||
"enum": [
|
||||
"approve",
|
||||
"decline"
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"description": "[UNSTABLE] Params for preempting a pending guardian approval review.",
|
||||
"properties": {
|
||||
"decision": {
|
||||
"$ref": "#/definitions/GuardianApprovalReviewOverrideDecision"
|
||||
},
|
||||
"reviewId": {
|
||||
"type": "string"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
},
|
||||
"turnId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"decision",
|
||||
"reviewId",
|
||||
"threadId",
|
||||
"turnId"
|
||||
],
|
||||
"title": "ItemGuardianApprovalReviewOverrideParams",
|
||||
"type": "object"
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "[UNSTABLE] Empty response for `item/autoApprovalReview/override`.",
|
||||
"title": "ItemGuardianApprovalReviewOverrideResponse",
|
||||
"type": "object"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -5,4 +5,4 @@
|
||||
/**
|
||||
* [UNSTABLE] Source that produced a terminal guardian approval review decision.
|
||||
*/
|
||||
export type AutoReviewDecisionSource = "agent";
|
||||
export type AutoReviewDecisionSource = "agent" | "user";
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
/**
|
||||
* [UNSTABLE] Client decision that preempts a pending guardian approval review.
|
||||
*/
|
||||
export type GuardianApprovalReviewOverrideDecision = "approve" | "decline";
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { GuardianApprovalReviewOverrideDecision } from "./GuardianApprovalReviewOverrideDecision";
|
||||
|
||||
/**
|
||||
* [UNSTABLE] Params for preempting a pending guardian approval review.
|
||||
*/
|
||||
export type ItemGuardianApprovalReviewOverrideParams = { threadId: string, turnId: string, reviewId: string, decision: GuardianApprovalReviewOverrideDecision, };
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
/**
|
||||
* [UNSTABLE] Empty response for `item/autoApprovalReview/override`.
|
||||
*/
|
||||
export type ItemGuardianApprovalReviewOverrideResponse = Record<string, never>;
|
||||
@@ -125,6 +125,7 @@ export type { GitInfo } from "./GitInfo";
|
||||
export type { GrantedPermissionProfile } from "./GrantedPermissionProfile";
|
||||
export type { GuardianApprovalReview } from "./GuardianApprovalReview";
|
||||
export type { GuardianApprovalReviewAction } from "./GuardianApprovalReviewAction";
|
||||
export type { GuardianApprovalReviewOverrideDecision } from "./GuardianApprovalReviewOverrideDecision";
|
||||
export type { GuardianApprovalReviewStatus } from "./GuardianApprovalReviewStatus";
|
||||
export type { GuardianCommandSource } from "./GuardianCommandSource";
|
||||
export type { GuardianRiskLevel } from "./GuardianRiskLevel";
|
||||
@@ -142,6 +143,8 @@ export type { HookScope } from "./HookScope";
|
||||
export type { HookStartedNotification } from "./HookStartedNotification";
|
||||
export type { ItemCompletedNotification } from "./ItemCompletedNotification";
|
||||
export type { ItemGuardianApprovalReviewCompletedNotification } from "./ItemGuardianApprovalReviewCompletedNotification";
|
||||
export type { ItemGuardianApprovalReviewOverrideParams } from "./ItemGuardianApprovalReviewOverrideParams";
|
||||
export type { ItemGuardianApprovalReviewOverrideResponse } from "./ItemGuardianApprovalReviewOverrideResponse";
|
||||
export type { ItemGuardianApprovalReviewStartedNotification } from "./ItemGuardianApprovalReviewStartedNotification";
|
||||
export type { ItemStartedNotification } from "./ItemStartedNotification";
|
||||
export type { ListMcpServerStatusParams } from "./ListMcpServerStatusParams";
|
||||
|
||||
@@ -424,6 +424,10 @@ client_request_definitions! {
|
||||
params: v2::ReviewStartParams,
|
||||
response: v2::ReviewStartResponse,
|
||||
},
|
||||
ItemGuardianApprovalReviewOverride => "item/autoApprovalReview/override" {
|
||||
params: v2::ItemGuardianApprovalReviewOverrideParams,
|
||||
response: v2::ItemGuardianApprovalReviewOverrideResponse,
|
||||
},
|
||||
|
||||
ModelList => "model/list" {
|
||||
params: v2::ModelListParams,
|
||||
|
||||
@@ -54,6 +54,7 @@ use codex_protocol::protocol::CreditsSnapshot as CoreCreditsSnapshot;
|
||||
use codex_protocol::protocol::ExecCommandSource as CoreExecCommandSource;
|
||||
use codex_protocol::protocol::ExecCommandStatus as CoreExecCommandStatus;
|
||||
use codex_protocol::protocol::GranularApprovalConfig as CoreGranularApprovalConfig;
|
||||
use codex_protocol::protocol::GuardianReviewOverrideDecision as CoreGuardianReviewOverrideDecision;
|
||||
use codex_protocol::protocol::GuardianRiskLevel as CoreGuardianRiskLevel;
|
||||
use codex_protocol::protocol::GuardianUserAuthorization as CoreGuardianUserAuthorization;
|
||||
use codex_protocol::protocol::HookEventName as CoreHookEventName;
|
||||
@@ -4541,12 +4542,33 @@ pub enum GuardianApprovalReviewStatus {
|
||||
/// [UNSTABLE] Source that produced a terminal guardian approval review decision.
|
||||
pub enum AutoReviewDecisionSource {
|
||||
Agent,
|
||||
#[serde(alias = "clientOverride")]
|
||||
User,
|
||||
}
|
||||
|
||||
impl From<CoreGuardianAssessmentDecisionSource> for AutoReviewDecisionSource {
|
||||
fn from(value: CoreGuardianAssessmentDecisionSource) -> Self {
|
||||
match value {
|
||||
CoreGuardianAssessmentDecisionSource::Agent => Self::Agent,
|
||||
CoreGuardianAssessmentDecisionSource::User => Self::User,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
/// [UNSTABLE] Client decision that preempts a pending guardian approval review.
|
||||
pub enum GuardianApprovalReviewOverrideDecision {
|
||||
Approve,
|
||||
Decline,
|
||||
}
|
||||
|
||||
impl From<GuardianApprovalReviewOverrideDecision> for CoreGuardianReviewOverrideDecision {
|
||||
fn from(value: GuardianApprovalReviewOverrideDecision) -> Self {
|
||||
match value {
|
||||
GuardianApprovalReviewOverrideDecision::Approve => Self::Approve,
|
||||
GuardianApprovalReviewOverrideDecision::Decline => Self::Decline,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4608,6 +4630,23 @@ pub struct GuardianApprovalReview {
|
||||
pub rationale: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
/// [UNSTABLE] Params for preempting a pending guardian approval review.
|
||||
pub struct ItemGuardianApprovalReviewOverrideParams {
|
||||
pub thread_id: String,
|
||||
pub turn_id: String,
|
||||
pub review_id: String,
|
||||
pub decision: GuardianApprovalReviewOverrideDecision,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
/// [UNSTABLE] Empty response for `item/autoApprovalReview/override`.
|
||||
pub struct ItemGuardianApprovalReviewOverrideResponse {}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(rename_all = "camelCase")]
|
||||
|
||||
Reference in New Issue
Block a user