app-server: add review ids for guardian notifications

Keep `targetItemId` as a deprecated compatibility alias while emitting the clearer `reviewId` field on legacy guardian approval review notifications.\n\nCo-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Charles Cunningham
2026-03-22 15:36:06 -07:00
parent 33077d50e1
commit 8e2dc92d6a
12 changed files with 195 additions and 20 deletions
@@ -1349,7 +1349,7 @@
"type": "object"
},
"ItemGuardianApprovalReviewCompletedNotification": {
"description": "[UNSTABLE] Temporary notification payload for guardian automatic approval review. This shape is expected to change soon.\n\nTODO(ccunningham): Attach guardian review state to the reviewed tool item's lifecycle instead of sending separate standalone review notifications so the app-server API can persist and replay review state via `thread/read`.",
"description": "[UNSTABLE] Temporary notification payload for guardian automatic approval review.\n\nTODO(ccunningham): Attach guardian review state to the reviewed tool item's lifecycle instead of sending separate standalone review notifications so the app-server API can persist and replay review state via `thread/read`.",
"properties": {
"action": true,
"parentToolItemId": {
@@ -1362,7 +1362,16 @@
"review": {
"$ref": "#/definitions/GuardianApprovalReview"
},
"reviewId": {
"default": null,
"description": "Stable guardian review identifier for matching started/completed events.",
"type": [
"string",
"null"
]
},
"targetItemId": {
"description": "Deprecated alias for `review_id`, retained for backwards compatibility.",
"type": "string"
},
"threadId": {
@@ -1381,7 +1390,7 @@
"type": "object"
},
"ItemGuardianApprovalReviewStartedNotification": {
"description": "[UNSTABLE] Temporary notification payload for guardian automatic approval review. This shape is expected to change soon.\n\nTODO(ccunningham): Attach guardian review state to the reviewed tool item's lifecycle instead of sending separate standalone review notifications so the app-server API can persist and replay review state via `thread/read`.",
"description": "[UNSTABLE] Temporary notification payload for guardian automatic approval review.\n\nTODO(ccunningham): Attach guardian review state to the reviewed tool item's lifecycle instead of sending separate standalone review notifications so the app-server API can persist and replay review state via `thread/read`.",
"properties": {
"action": true,
"parentToolItemId": {
@@ -1394,7 +1403,16 @@
"review": {
"$ref": "#/definitions/GuardianApprovalReview"
},
"reviewId": {
"default": null,
"description": "Stable guardian review identifier for matching started/completed events.",
"type": [
"string",
"null"
]
},
"targetItemId": {
"description": "Deprecated alias for `review_id`, retained for backwards compatibility.",
"type": "string"
},
"threadId": {
@@ -8196,7 +8196,7 @@
},
"ItemGuardianApprovalReviewCompletedNotification": {
"$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.\n\nTODO(ccunningham): Attach guardian review state to the reviewed tool item's lifecycle instead of sending separate standalone review notifications so the app-server API can persist and replay review state via `thread/read`.",
"description": "[UNSTABLE] Temporary notification payload for guardian automatic approval review.\n\nTODO(ccunningham): Attach guardian review state to the reviewed tool item's lifecycle instead of sending separate standalone review notifications so the app-server API can persist and replay review state via `thread/read`.",
"properties": {
"action": true,
"parentToolItemId": {
@@ -8209,7 +8209,16 @@
"review": {
"$ref": "#/definitions/v2/GuardianApprovalReview"
},
"reviewId": {
"default": null,
"description": "Stable guardian review identifier for matching started/completed events.",
"type": [
"string",
"null"
]
},
"targetItemId": {
"description": "Deprecated alias for `review_id`, retained for backwards compatibility.",
"type": "string"
},
"threadId": {
@@ -8230,7 +8239,7 @@
},
"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.\n\nTODO(ccunningham): Attach guardian review state to the reviewed tool item's lifecycle instead of sending separate standalone review notifications so the app-server API can persist and replay review state via `thread/read`.",
"description": "[UNSTABLE] Temporary notification payload for guardian automatic approval review.\n\nTODO(ccunningham): Attach guardian review state to the reviewed tool item's lifecycle instead of sending separate standalone review notifications so the app-server API can persist and replay review state via `thread/read`.",
"properties": {
"action": true,
"parentToolItemId": {
@@ -8243,7 +8252,16 @@
"review": {
"$ref": "#/definitions/v2/GuardianApprovalReview"
},
"reviewId": {
"default": null,
"description": "Stable guardian review identifier for matching started/completed events.",
"type": [
"string",
"null"
]
},
"targetItemId": {
"description": "Deprecated alias for `review_id`, retained for backwards compatibility.",
"type": "string"
},
"threadId": {
@@ -4944,7 +4944,7 @@
},
"ItemGuardianApprovalReviewCompletedNotification": {
"$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.\n\nTODO(ccunningham): Attach guardian review state to the reviewed tool item's lifecycle instead of sending separate standalone review notifications so the app-server API can persist and replay review state via `thread/read`.",
"description": "[UNSTABLE] Temporary notification payload for guardian automatic approval review.\n\nTODO(ccunningham): Attach guardian review state to the reviewed tool item's lifecycle instead of sending separate standalone review notifications so the app-server API can persist and replay review state via `thread/read`.",
"properties": {
"action": true,
"parentToolItemId": {
@@ -4957,7 +4957,16 @@
"review": {
"$ref": "#/definitions/GuardianApprovalReview"
},
"reviewId": {
"default": null,
"description": "Stable guardian review identifier for matching started/completed events.",
"type": [
"string",
"null"
]
},
"targetItemId": {
"description": "Deprecated alias for `review_id`, retained for backwards compatibility.",
"type": "string"
},
"threadId": {
@@ -4978,7 +4987,7 @@
},
"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.\n\nTODO(ccunningham): Attach guardian review state to the reviewed tool item's lifecycle instead of sending separate standalone review notifications so the app-server API can persist and replay review state via `thread/read`.",
"description": "[UNSTABLE] Temporary notification payload for guardian automatic approval review.\n\nTODO(ccunningham): Attach guardian review state to the reviewed tool item's lifecycle instead of sending separate standalone review notifications so the app-server API can persist and replay review state via `thread/read`.",
"properties": {
"action": true,
"parentToolItemId": {
@@ -4991,7 +5000,16 @@
"review": {
"$ref": "#/definitions/GuardianApprovalReview"
},
"reviewId": {
"default": null,
"description": "Stable guardian review identifier for matching started/completed events.",
"type": [
"string",
"null"
]
},
"targetItemId": {
"description": "Deprecated alias for `review_id`, retained for backwards compatibility.",
"type": "string"
},
"threadId": {
@@ -57,7 +57,7 @@
"type": "string"
}
},
"description": "[UNSTABLE] Temporary notification payload for guardian automatic approval review. This shape is expected to change soon.\n\nTODO(ccunningham): Attach guardian review state to the reviewed tool item's lifecycle instead of sending separate standalone review notifications so the app-server API can persist and replay review state via `thread/read`.",
"description": "[UNSTABLE] Temporary notification payload for guardian automatic approval review.\n\nTODO(ccunningham): Attach guardian review state to the reviewed tool item's lifecycle instead of sending separate standalone review notifications so the app-server API can persist and replay review state via `thread/read`.",
"properties": {
"action": true,
"parentToolItemId": {
@@ -70,7 +70,16 @@
"review": {
"$ref": "#/definitions/GuardianApprovalReview"
},
"reviewId": {
"default": null,
"description": "Stable guardian review identifier for matching started/completed events.",
"type": [
"string",
"null"
]
},
"targetItemId": {
"description": "Deprecated alias for `review_id`, retained for backwards compatibility.",
"type": "string"
},
"threadId": {
@@ -57,7 +57,7 @@
"type": "string"
}
},
"description": "[UNSTABLE] Temporary notification payload for guardian automatic approval review. This shape is expected to change soon.\n\nTODO(ccunningham): Attach guardian review state to the reviewed tool item's lifecycle instead of sending separate standalone review notifications so the app-server API can persist and replay review state via `thread/read`.",
"description": "[UNSTABLE] Temporary notification payload for guardian automatic approval review.\n\nTODO(ccunningham): Attach guardian review state to the reviewed tool item's lifecycle instead of sending separate standalone review notifications so the app-server API can persist and replay review state via `thread/read`.",
"properties": {
"action": true,
"parentToolItemId": {
@@ -70,7 +70,16 @@
"review": {
"$ref": "#/definitions/GuardianApprovalReview"
},
"reviewId": {
"default": null,
"description": "Stable guardian review identifier for matching started/completed events.",
"type": [
"string",
"null"
]
},
"targetItemId": {
"description": "Deprecated alias for `review_id`, retained for backwards compatibility.",
"type": "string"
},
"threadId": {
@@ -6,10 +6,18 @@ import type { GuardianApprovalReview } from "./GuardianApprovalReview";
/**
* [UNSTABLE] Temporary notification payload for guardian automatic approval
* review. This shape is expected to change soon.
* review.
*
* TODO(ccunningham): Attach guardian review state to the reviewed tool item's
* lifecycle instead of sending separate standalone review notifications so the
* app-server API can persist and replay review state via `thread/read`.
*/
export type ItemGuardianApprovalReviewCompletedNotification = { threadId: string, turnId: string, targetItemId: string, parentToolItemId: string | null, review: GuardianApprovalReview, action: JsonValue | null, };
export type ItemGuardianApprovalReviewCompletedNotification = { threadId: string, turnId: string,
/**
* Deprecated alias for `review_id`, retained for backwards compatibility.
*/
targetItemId: string,
/**
* Stable guardian review identifier for matching started/completed events.
*/
reviewId: string | null, parentToolItemId: string | null, review: GuardianApprovalReview, action: JsonValue | null, };
@@ -6,10 +6,18 @@ import type { GuardianApprovalReview } from "./GuardianApprovalReview";
/**
* [UNSTABLE] Temporary notification payload for guardian automatic approval
* review. This shape is expected to change soon.
* review.
*
* TODO(ccunningham): Attach guardian review state to the reviewed tool item's
* lifecycle instead of sending separate standalone review notifications so the
* app-server API can persist and replay review state via `thread/read`.
*/
export type ItemGuardianApprovalReviewStartedNotification = { threadId: string, turnId: string, targetItemId: string, parentToolItemId: string | null, review: GuardianApprovalReview, action: JsonValue | null, };
export type ItemGuardianApprovalReviewStartedNotification = { threadId: string, turnId: string,
/**
* Deprecated alias for `review_id`, retained for backwards compatibility.
*/
targetItemId: string,
/**
* Stable guardian review identifier for matching started/completed events.
*/
reviewId: string | null, parentToolItemId: string | null, review: GuardianApprovalReview, action: JsonValue | null, };
@@ -4830,7 +4830,7 @@ pub struct ItemStartedNotification {
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
/// [UNSTABLE] Temporary notification payload for guardian automatic approval
/// review. This shape is expected to change soon.
/// review.
///
/// TODO(ccunningham): Attach guardian review state to the reviewed tool item's
/// lifecycle instead of sending separate standalone review notifications so the
@@ -4838,7 +4838,11 @@ pub struct ItemStartedNotification {
pub struct ItemGuardianApprovalReviewStartedNotification {
pub thread_id: String,
pub turn_id: String,
/// Deprecated alias for `review_id`, retained for backwards compatibility.
pub target_item_id: String,
/// Stable guardian review identifier for matching started/completed events.
#[serde(default)]
pub review_id: Option<String>,
#[serde(default)]
pub parent_tool_item_id: Option<String>,
pub review: GuardianApprovalReview,
@@ -4849,7 +4853,7 @@ pub struct ItemGuardianApprovalReviewStartedNotification {
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
/// [UNSTABLE] Temporary notification payload for guardian automatic approval
/// review. This shape is expected to change soon.
/// review.
///
/// TODO(ccunningham): Attach guardian review state to the reviewed tool item's
/// lifecycle instead of sending separate standalone review notifications so the
@@ -4857,7 +4861,11 @@ pub struct ItemGuardianApprovalReviewStartedNotification {
pub struct ItemGuardianApprovalReviewCompletedNotification {
pub thread_id: String,
pub turn_id: String,
/// Deprecated alias for `review_id`, retained for backwards compatibility.
pub target_item_id: String,
/// Stable guardian review identifier for matching started/completed events.
#[serde(default)]
pub review_id: Option<String>,
#[serde(default)]
pub parent_tool_item_id: Option<String>,
pub review: GuardianApprovalReview,