mirror of
https://github.com/openai/codex.git
synced 2026-11-20 22:40:37 +00:00
codex: strip guardian reviewThreadId from app protocol
Keep the guardian rollout attachment plumbing for /feedback uploads, but remove the unnecessary app-server notification/schema field so the PR stays narrowly scoped. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
co-authored by
Codex
parent
56b7efcb98
commit
4da3243b0e
@@ -1066,12 +1066,6 @@
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"reviewThreadId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"riskLevel": {
|
||||
"anyOf": [
|
||||
{
|
||||
|
||||
@@ -7810,12 +7810,6 @@
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"reviewThreadId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"riskLevel": {
|
||||
"anyOf": [
|
||||
{
|
||||
|
||||
@@ -4554,12 +4554,6 @@
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"reviewThreadId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"riskLevel": {
|
||||
"anyOf": [
|
||||
{
|
||||
|
||||
-6
@@ -10,12 +10,6 @@
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"reviewThreadId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"riskLevel": {
|
||||
"anyOf": [
|
||||
{
|
||||
|
||||
-6
@@ -10,12 +10,6 @@
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"reviewThreadId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"riskLevel": {
|
||||
"anyOf": [
|
||||
{
|
||||
|
||||
@@ -9,4 +9,4 @@ import type { GuardianRiskLevel } from "./GuardianRiskLevel";
|
||||
* `item/autoApprovalReview/*` notifications. This shape is expected to change
|
||||
* soon.
|
||||
*/
|
||||
export type GuardianApprovalReview = { status: GuardianApprovalReviewStatus, reviewThreadId: string | null, riskScore: number | null, riskLevel: GuardianRiskLevel | null, rationale: string | null, };
|
||||
export type GuardianApprovalReview = { status: GuardianApprovalReviewStatus, riskScore: number | null, riskLevel: GuardianRiskLevel | null, rationale: string | null, };
|
||||
|
||||
@@ -4297,9 +4297,6 @@ impl From<CoreGuardianRiskLevel> for GuardianRiskLevel {
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct GuardianApprovalReview {
|
||||
pub status: GuardianApprovalReviewStatus,
|
||||
#[serde(alias = "review_thread_id")]
|
||||
#[ts(type = "string | null")]
|
||||
pub review_thread_id: Option<String>,
|
||||
#[serde(alias = "risk_score")]
|
||||
#[ts(type = "number | null")]
|
||||
pub risk_score: Option<u8>,
|
||||
@@ -7350,7 +7347,6 @@ mod tests {
|
||||
review,
|
||||
GuardianApprovalReview {
|
||||
status: GuardianApprovalReviewStatus::Denied,
|
||||
review_thread_id: None,
|
||||
risk_score: Some(91),
|
||||
risk_level: Some(GuardianRiskLevel::High),
|
||||
rationale: Some("too risky".to_string()),
|
||||
@@ -7371,7 +7367,6 @@ mod tests {
|
||||
review,
|
||||
GuardianApprovalReview {
|
||||
status: GuardianApprovalReviewStatus::Aborted,
|
||||
review_thread_id: None,
|
||||
risk_score: None,
|
||||
risk_level: None,
|
||||
rationale: None,
|
||||
|
||||
@@ -215,9 +215,6 @@ fn guardian_auto_approval_review_notification(
|
||||
GuardianApprovalReviewStatus::Aborted
|
||||
}
|
||||
},
|
||||
review_thread_id: assessment
|
||||
.review_thread_id
|
||||
.map(|thread_id| thread_id.to_string()),
|
||||
risk_score: assessment.risk_score,
|
||||
risk_level: assessment.risk_level.map(Into::into),
|
||||
rationale: assessment.rationale.clone(),
|
||||
@@ -2824,7 +2821,6 @@ mod tests {
|
||||
payload.review.status,
|
||||
GuardianApprovalReviewStatus::InProgress
|
||||
);
|
||||
assert_eq!(payload.review.review_thread_id, None);
|
||||
assert_eq!(payload.review.risk_score, None);
|
||||
assert_eq!(payload.review.risk_level, None);
|
||||
assert_eq!(payload.review.rationale, None);
|
||||
@@ -2847,7 +2843,7 @@ mod tests {
|
||||
&GuardianAssessmentEvent {
|
||||
id: "item-2".to_string(),
|
||||
turn_id: "turn-from-assessment".to_string(),
|
||||
review_thread_id: Some(ThreadId::new()),
|
||||
review_thread_id: None,
|
||||
status: codex_protocol::protocol::GuardianAssessmentStatus::Denied,
|
||||
risk_score: Some(91),
|
||||
risk_level: Some(codex_protocol::protocol::GuardianRiskLevel::High),
|
||||
@@ -2862,7 +2858,6 @@ mod tests {
|
||||
assert_eq!(payload.turn_id, "turn-from-assessment");
|
||||
assert_eq!(payload.target_item_id, "item-2");
|
||||
assert_eq!(payload.review.status, GuardianApprovalReviewStatus::Denied);
|
||||
assert!(payload.review.review_thread_id.is_some());
|
||||
assert_eq!(payload.review.risk_score, Some(91));
|
||||
assert_eq!(
|
||||
payload.review.risk_level,
|
||||
@@ -2903,7 +2898,6 @@ mod tests {
|
||||
assert_eq!(payload.turn_id, "turn-from-assessment");
|
||||
assert_eq!(payload.target_item_id, "item-3");
|
||||
assert_eq!(payload.review.status, GuardianApprovalReviewStatus::Aborted);
|
||||
assert_eq!(payload.review.review_thread_id, None);
|
||||
assert_eq!(payload.review.risk_score, None);
|
||||
assert_eq!(payload.review.risk_level, None);
|
||||
assert_eq!(payload.review.rationale, None);
|
||||
|
||||
@@ -6253,10 +6253,7 @@ impl ChatWidget {
|
||||
self.on_guardian_assessment(GuardianAssessmentEvent {
|
||||
id,
|
||||
turn_id,
|
||||
review_thread_id: review
|
||||
.review_thread_id
|
||||
.as_deref()
|
||||
.and_then(|thread_id| ThreadId::from_string(thread_id).ok()),
|
||||
review_thread_id: None,
|
||||
status: match review.status {
|
||||
codex_app_server_protocol::GuardianApprovalReviewStatus::InProgress => {
|
||||
GuardianAssessmentStatus::InProgress
|
||||
|
||||
@@ -10229,7 +10229,6 @@ async fn app_server_guardian_review_started_sets_review_status() {
|
||||
target_item_id: "guardian-1".to_string(),
|
||||
review: GuardianApprovalReview {
|
||||
status: GuardianApprovalReviewStatus::InProgress,
|
||||
review_thread_id: None,
|
||||
risk_score: None,
|
||||
risk_level: None,
|
||||
rationale: None,
|
||||
@@ -10268,7 +10267,6 @@ async fn app_server_guardian_review_denied_renders_denied_request_snapshot() {
|
||||
target_item_id: "guardian-1".to_string(),
|
||||
review: GuardianApprovalReview {
|
||||
status: GuardianApprovalReviewStatus::InProgress,
|
||||
review_thread_id: None,
|
||||
risk_score: None,
|
||||
risk_level: None,
|
||||
rationale: None,
|
||||
@@ -10287,7 +10285,6 @@ async fn app_server_guardian_review_denied_renders_denied_request_snapshot() {
|
||||
target_item_id: "guardian-1".to_string(),
|
||||
review: GuardianApprovalReview {
|
||||
status: GuardianApprovalReviewStatus::Denied,
|
||||
review_thread_id: None,
|
||||
risk_score: Some(96),
|
||||
risk_level: Some(AppServerGuardianRiskLevel::High),
|
||||
rationale: Some("Would exfiltrate local source code.".to_string()),
|
||||
|
||||
Reference in New Issue
Block a user