diff --git a/codex-rs/app-server-protocol/schema/json/ServerNotification.json b/codex-rs/app-server-protocol/schema/json/ServerNotification.json index efe32172f4..2c5639eef4 100644 --- a/codex-rs/app-server-protocol/schema/json/ServerNotification.json +++ b/codex-rs/app-server-protocol/schema/json/ServerNotification.json @@ -305,6 +305,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -3808,6 +3817,33 @@ ], "type": "object" }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "RateLimitReachedType": { "enum": [ "rate_limit_reached", diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json index 8d77d55c87..7f2ecbcd18 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json @@ -7720,6 +7720,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/v2/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -19730,6 +19739,33 @@ ], "type": "string" }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ProviderSettings": { "oneOf": [ { diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json index 4b5c2ff1e2..d4b18554ac 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json @@ -710,6 +710,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -15590,6 +15599,33 @@ ], "type": "string" }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ProviderSettings": { "oneOf": [ { diff --git a/codex-rs/app-server-protocol/schema/json/v2/ItemCompletedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/ItemCompletedNotification.json index 653fd81ddf..00534f392d 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ItemCompletedNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ItemCompletedNotification.json @@ -121,6 +121,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -991,6 +1000,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ItemStartedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/ItemStartedNotification.json index 44216fbc83..2b519ede24 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ItemStartedNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ItemStartedNotification.json @@ -121,6 +121,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -991,6 +1000,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ReviewStartResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ReviewStartResponse.json index a11d177599..5979ee0a86 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ReviewStartResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ReviewStartResponse.json @@ -121,6 +121,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -1207,6 +1216,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json index 9fc321da40..d742afae5c 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json @@ -141,6 +141,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -1343,6 +1352,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadItemsListResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadItemsListResponse.json index c8034e97f5..5a3bff2468 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadItemsListResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadItemsListResponse.json @@ -121,6 +121,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -991,6 +1000,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json index e088e2d732..9c3df7a9e7 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json @@ -121,6 +121,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -1233,6 +1242,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json index c03d5d428c..49d9e91254 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json @@ -121,6 +121,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -1233,6 +1242,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json index 747387a373..dc99327983 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json @@ -121,6 +121,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -1233,6 +1242,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json index fe078fb52b..dfcb4cfbd5 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json @@ -141,6 +141,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -1367,6 +1376,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadRevertResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadRevertResponse.json index 28dcd5296e..3f97da5d5e 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadRevertResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadRevertResponse.json @@ -121,6 +121,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -1233,6 +1242,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadSearchPartialNotification.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadSearchPartialNotification.json index 78b0ff782f..98ea602569 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadSearchPartialNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadSearchPartialNotification.json @@ -121,6 +121,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -1233,6 +1242,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json index 8ec2a2e0a7..b8db288d72 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json @@ -141,6 +141,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -1343,6 +1352,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json index 726a04d7f6..d6765c0c16 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json @@ -121,6 +121,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -1233,6 +1242,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadTurnsListResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadTurnsListResponse.json index 5632dda4fc..f2751899d5 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadTurnsListResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadTurnsListResponse.json @@ -121,6 +121,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -1207,6 +1216,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json index 64604f7982..84e75c4d59 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json @@ -121,6 +121,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -1233,6 +1242,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/TurnCompletedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/TurnCompletedNotification.json index 5699fea692..dd538b1429 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/TurnCompletedNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/TurnCompletedNotification.json @@ -121,6 +121,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -1207,6 +1216,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/TurnStartResponse.json b/codex-rs/app-server-protocol/schema/json/v2/TurnStartResponse.json index 83121d44ca..1361b3d10f 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/TurnStartResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/TurnStartResponse.json @@ -121,6 +121,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -1207,6 +1216,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/json/v2/TurnStartedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/TurnStartedNotification.json index 0c8a8552a3..d831ab139f 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/TurnStartedNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/TurnStartedNotification.json @@ -121,6 +121,15 @@ }, "moderated": { "type": "boolean" + }, + "promptWellbeingResults": { + "items": { + "$ref": "#/definitions/PromptWellbeingResult" + }, + "type": [ + "array", + "null" + ] } }, "required": [ @@ -1207,6 +1216,33 @@ } ] }, + "PromptWellbeingResult": { + "description": "Wellbeing results for a single scored input item.", + "properties": { + "inputItemId": { + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scores": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + } + }, + "required": [ + "inputItemId", + "labels", + "scores" + ], + "type": "object" + }, "ReasoningEffort": { "description": "A non-empty reasoning effort value advertised by the model.", "minLength": 1, diff --git a/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-experimental.json.zst b/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-experimental.json.zst index 789366e731..82fa859880 100644 Binary files a/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-experimental.json.zst and b/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-experimental.json.zst differ diff --git a/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-stable.json.zst b/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-stable.json.zst index fc07b9fe01..e707f011e8 100644 Binary files a/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-stable.json.zst and b/codex-rs/app-server-protocol/schema/precomputed/app-server-exports-stable.json.zst differ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/AgentMessageModeration.ts b/codex-rs/app-server-protocol/schema/typescript/v2/AgentMessageModeration.ts index b75a92acf3..d4c21b8315 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/AgentMessageModeration.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/AgentMessageModeration.ts @@ -2,5 +2,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { AgentMessageDisplay } from "./AgentMessageDisplay"; +import type { PromptWellbeingResult } from "./PromptWellbeingResult"; -export type AgentMessageModeration = { moderated: boolean, display: AgentMessageDisplay | null, }; +export type AgentMessageModeration = { promptWellbeingResults: Array | null, moderated: boolean, display: AgentMessageDisplay | null, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/PromptWellbeingResult.ts b/codex-rs/app-server-protocol/schema/typescript/v2/PromptWellbeingResult.ts new file mode 100644 index 0000000000..9dcdd4e282 --- /dev/null +++ b/codex-rs/app-server-protocol/schema/typescript/v2/PromptWellbeingResult.ts @@ -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. + +/** + * Wellbeing results for a single scored input item. + */ +export type PromptWellbeingResult = { inputItemId: string, scores: Record, labels: Array, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/index.ts b/codex-rs/app-server-protocol/schema/typescript/v2/index.ts index 21af7c74f0..a26e1c75b0 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/index.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/index.ts @@ -453,6 +453,7 @@ export type { ProjectChangeType } from "./ProjectChangeType"; export type { ProjectChangedNotification } from "./ProjectChangedNotification"; export type { ProjectRoot } from "./ProjectRoot"; export type { ProjectSortKey } from "./ProjectSortKey"; +export type { PromptWellbeingResult } from "./PromptWellbeingResult"; export type { ProviderSettings } from "./ProviderSettings"; export type { ProviderSettingsPatch } from "./ProviderSettingsPatch"; export type { QueuedSubmission } from "./QueuedSubmission"; diff --git a/codex-rs/app-server-protocol/src/protocol/thread_history.rs b/codex-rs/app-server-protocol/src/protocol/thread_history.rs index d0c966e9f1..6f30931990 100644 --- a/codex-rs/app-server-protocol/src/protocol/thread_history.rs +++ b/codex-rs/app-server-protocol/src/protocol/thread_history.rs @@ -666,6 +666,7 @@ impl ThreadHistoryBuilder { .moderation .as_ref() .map(|decision| AgentMessageModeration { + prompt_wellbeing_results: decision.prompt_wellbeing_results.clone(), moderated: decision.moderated, display: decision.display.clone(), }), diff --git a/codex-rs/app-server-protocol/src/protocol/v2/item.rs b/codex-rs/app-server-protocol/src/protocol/v2/item.rs index 274d438012..df059fb9d5 100644 --- a/codex-rs/app-server-protocol/src/protocol/v2/item.rs +++ b/codex-rs/app-server-protocol/src/protocol/v2/item.rs @@ -38,6 +38,7 @@ use codex_protocol::items::DynamicToolCallStatus as CoreDynamicToolCallStatus; pub use codex_protocol::items::McpAppDisplayMode; pub use codex_protocol::items::McpAppUi; use codex_protocol::items::McpToolCallStatus as CoreMcpToolCallStatus; +pub use codex_protocol::items::PromptWellbeingResult; use codex_protocol::items::TurnItem as CoreTurnItem; use codex_protocol::memory_citation::MemoryCitation as CoreMemoryCitation; use codex_protocol::memory_citation::MemoryCitationEntry as CoreMemoryCitationEntry; @@ -156,6 +157,7 @@ pub enum CommandAction { #[ts(export_to = "v2/")] #[serde(from = "CoreAgentMessageModeration")] pub struct AgentMessageModeration { + pub prompt_wellbeing_results: Option>, pub moderated: bool, pub display: Option, } @@ -163,6 +165,7 @@ pub struct AgentMessageModeration { impl From for AgentMessageModeration { fn from(value: CoreAgentMessageModeration) -> Self { Self { + prompt_wellbeing_results: value.prompt_wellbeing_results, moderated: value.moderated, display: value.display, } diff --git a/codex-rs/app-server-protocol/src/protocol/v2/tests.rs b/codex-rs/app-server-protocol/src/protocol/v2/tests.rs index 1837c0cade..5c6e9d090a 100644 --- a/codex-rs/app-server-protocol/src/protocol/v2/tests.rs +++ b/codex-rs/app-server-protocol/src/protocol/v2/tests.rs @@ -3276,7 +3276,7 @@ fn answer_moderation_preserves_the_display_instruction() { json!({"version":1, "mode":"block", "reason":{"kind":"protection","protectionType":"omnimod"}}), json!({"version":1, "mode":"block", "reason":{"kind":"cyber","trustedAccess":false}}), ] { - let stored = json!({"moderated": !display.is_null(), "display": display}); + let mut stored = json!({"moderated": !display.is_null(), "display": display}); let mut with_extra_fields = stored.clone(); if let Some(object) = with_extra_fields["display"].as_object_mut() { object.insert("additionalV1Field".into(), json!(true)); @@ -3285,6 +3285,7 @@ fn answer_moderation_preserves_the_display_instruction() { with_extra_fields, ) .unwrap(); + stored["promptWellbeingResults"] = JsonValue::Null; assert_eq!( serde_json::to_value(AgentMessageModeration::from(core)).unwrap(), stored @@ -3292,6 +3293,25 @@ fn answer_moderation_preserves_the_display_instruction() { } } +#[test] +fn prompt_wellbeing_results_round_trip_with_or_without_display() { + for display in [ + json!({"version": 1, "mode": "show", "trustedContacts": "check"}), + JsonValue::Null, + ] { + let stored = json!({ + "moderated": true, + "display": display, + "promptWellbeingResults": [{"inputItemId":"msg_input_1","labels":[],"scores":{"U-S4":0.1}}] + }); + let core: codex_protocol::items::AgentMessageModeration = + serde_json::from_value(stored.clone()).unwrap(); + let decision: AgentMessageModeration = + serde_json::from_value(serde_json::to_value(core).unwrap()).unwrap(); + assert_eq!(serde_json::to_value(decision).unwrap(), stored); + } +} + #[test] fn core_turn_item_into_thread_item_converts_supported_variants() { let user_item = TurnItem::UserMessage(UserMessageItem { @@ -3420,6 +3440,7 @@ fn core_turn_item_into_thread_item_converts_supported_variants() { let agent_item_with_phase = TurnItem::AgentMessage(AgentMessageItem { moderation: Some(codex_protocol::items::AgentMessageModeration { + prompt_wellbeing_results: None, moderated: true, display: None, }), @@ -3445,6 +3466,7 @@ fn core_turn_item_into_thread_item_converts_supported_variants() { ThreadItemPayload::from(agent_item_with_phase), ThreadItemPayload::AgentMessage { moderation: Some(AgentMessageModeration { + prompt_wellbeing_results: None, moderated: true, display: None }), diff --git a/codex-rs/core/src/stream_events_utils.rs b/codex-rs/core/src/stream_events_utils.rs index 5f4ac376e0..d93cec0ec9 100644 --- a/codex-rs/core/src/stream_events_utils.rs +++ b/codex-rs/core/src/stream_events_utils.rs @@ -341,6 +341,7 @@ pub(crate) fn apply_answer_moderation( && answer.id == decision.item_id { answer.moderation = Some(codex_protocol::items::AgentMessageModeration { + prompt_wellbeing_results: decision.prompt_wellbeing_results.clone(), moderated: decision.moderated, display: decision.display.clone(), }); diff --git a/codex-rs/protocol/src/items.rs b/codex-rs/protocol/src/items.rs index 14db09e1af..60a0bee495 100644 --- a/codex-rs/protocol/src/items.rs +++ b/codex-rs/protocol/src/items.rs @@ -6,6 +6,7 @@ pub use display::AnswerAnnotation; pub use display::AnswerReplacement; pub use display::BlockReason; pub use display::HelplineSubject; +pub use display::PromptWellbeingResult; pub use display::TrustedContacts; use crate::AgentPath; @@ -163,6 +164,13 @@ pub struct AsyncUserInputQuestion { #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, TS, JsonSchema)] #[serde(from = "display::StoredModeration")] pub struct AgentMessageModeration { + #[serde( + rename = "promptWellbeingResults", + default, + skip_serializing_if = "Option::is_none" + )] + #[ts(optional)] + pub prompt_wellbeing_results: Option>, pub moderated: bool, #[serde(default, skip_serializing_if = "Option::is_none")] #[ts(optional)] diff --git a/codex-rs/protocol/src/items/display.rs b/codex-rs/protocol/src/items/display.rs index 18a5c4bc6a..814864d1f6 100644 --- a/codex-rs/protocol/src/items/display.rs +++ b/codex-rs/protocol/src/items/display.rs @@ -123,25 +123,41 @@ pub enum BlockReason { }, } +/// Wellbeing results for a single scored input item. +#[derive(derive_more::Debug, Clone, PartialEq, Eq, Deserialize, Serialize, TS, JsonSchema)] +#[debug("PromptWellbeingResult([redacted])")] +#[serde(rename_all = "camelCase")] +#[ts(export_to = "v2/")] +pub struct PromptWellbeingResult { + pub input_item_id: String, + #[ts(type = "Record")] + #[schemars(with = "std::collections::BTreeMap")] + pub scores: std::collections::BTreeMap, + pub labels: Vec, +} + /// An unreadable instruction leaves the answer restricted. #[derive(Deserialize)] pub(super) struct StoredModeration { moderated: bool, display: Option, + #[serde(rename = "promptWellbeingResults")] + prompt_wellbeing_results: Option, } impl From for AgentMessageModeration { fn from(stored: StoredModeration) -> Self { - let Some(value) = stored.display else { - return Self { - moderated: stored.moderated, - display: None, - }; - }; - let display = serde_json::from_value(value).ok(); + let has_display = stored.display.is_some(); + let display = stored + .display + .and_then(|value| serde_json::from_value(value).ok()); Self { - moderated: stored.moderated || display.is_none(), + moderated: stored.moderated || (has_display && display.is_none()), display, + // An invalid optional result must never discard a block or clear a check. + prompt_wellbeing_results: stored + .prompt_wellbeing_results + .and_then(|value| serde_json::from_value(value).ok()), } } } diff --git a/codex-rs/protocol/src/legacy_events.rs b/codex-rs/protocol/src/legacy_events.rs index f432e75f73..84f7472f66 100644 --- a/codex-rs/protocol/src/legacy_events.rs +++ b/codex-rs/protocol/src/legacy_events.rs @@ -145,6 +145,7 @@ impl AgentMessageItem { texts.collect(), Some(crate::protocol::TargetedAnswerModeration { item_id: self.id.clone(), + prompt_wellbeing_results: decision.prompt_wellbeing_results.clone(), moderated: decision.moderated, display: decision.display.clone(), }), diff --git a/codex-rs/protocol/src/protocol.rs b/codex-rs/protocol/src/protocol.rs index 79584c8c3e..95ad95bde9 100644 --- a/codex-rs/protocol/src/protocol.rs +++ b/codex-rs/protocol/src/protocol.rs @@ -2417,6 +2417,13 @@ pub struct ModelVerificationEvent { #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema, TS)] #[serde(from = "StoredTargetedModeration")] pub struct TargetedAnswerModeration { + #[serde( + rename = "promptWellbeingResults", + default, + skip_serializing_if = "Option::is_none" + )] + #[ts(optional)] + pub prompt_wellbeing_results: Option>, pub item_id: String, pub moderated: bool, #[serde(default, skip_serializing_if = "Option::is_none")] @@ -2435,6 +2442,7 @@ impl From for TargetedAnswerModeration { fn from(value: StoredTargetedModeration) -> Self { Self { item_id: value.item_id, + prompt_wellbeing_results: value.decision.prompt_wellbeing_results, moderated: value.decision.moderated, display: value.decision.display, } diff --git a/codex-rs/thread-store/src/local/rollout_migration/legacy_event.rs b/codex-rs/thread-store/src/local/rollout_migration/legacy_event.rs index e1a0fa9b41..d4c3dfac79 100644 --- a/codex-rs/thread-store/src/local/rollout_migration/legacy_event.rs +++ b/codex-rs/thread-store/src/local/rollout_migration/legacy_event.rs @@ -160,6 +160,7 @@ pub(super) fn completed_item( TurnItem::AgentMessage(AgentMessageItem { moderation: event.moderation.as_ref().map(|decision| { codex_protocol::items::AgentMessageModeration { + prompt_wellbeing_results: decision.prompt_wellbeing_results.clone(), moderated: decision.moderated, display: decision.display.clone(), } diff --git a/sdk/python/src/openai_codex/generated/v2_all.py b/sdk/python/src/openai_codex/generated/v2_all.py index 32df51d95f..3e0c5a8232 100644 --- a/sdk/python/src/openai_codex/generated/v2_all.py +++ b/sdk/python/src/openai_codex/generated/v2_all.py @@ -3947,6 +3947,15 @@ class ProjectSortKey(Enum): recency_at = "recencyAt" +class PromptWellbeingResult(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + input_item_id: Annotated[str, Field(alias="inputItemId")] + labels: list[str] + scores: dict[str, float] + + class OpenaiProviderSettings(BaseModel): model_config = ConfigDict( populate_by_name=True, @@ -11909,6 +11918,9 @@ class AgentMessageModeration(BaseModel): ) display: AgentMessageDisplay | None = None moderated: bool + prompt_wellbeing_results: Annotated[ + list[PromptWellbeingResult] | None, Field(alias="promptWellbeingResults") + ] = None class AppInfo(BaseModel):