mirror of
https://github.com/openai/codex.git
synced 2026-11-14 21:40:39 +00:00
Expose Guardian assessments in response streams (#57757)
## What changed Decode `response.metadata` Guardian assessments into typed `GuardianAssessment` events over SSE and WebSocket, carrying `response_id`, `item_id`, and `requires_review`. Ignore assessments with missing, empty, or incorrectly typed required fields while preserving independent delivery of other metadata. Expose the assessment type to request-scoped extension interceptors. Keep assessments out of conversation history; they do not authorize tool execution. ## Testing Add SSE coverage for assessment ordering, malformed metadata, and mixed metadata delivery. Extend model request tests to cover SSE and WebSocket interceptor delivery and exclusion from subsequent model input. GitOrigin-RevId: 282b8817ee97346d76b40bcb412eef023df60ff1
This commit is contained in:
@@ -93,6 +93,8 @@ pub enum ResponseEvent {
|
||||
ModelVerifications(Vec<ModelVerification>),
|
||||
/// Emitted when the server includes moderation metadata for first-party turn presentation.
|
||||
TurnModerationMetadata(TurnModerationMetadataEvent),
|
||||
/// Action-bound Guardian evidence for request-scoped consumers, not model history.
|
||||
GuardianAssessment(crate::guardian_assessment::GuardianAssessment),
|
||||
/// Emitted when `X-Reasoning-Included: true` is present on the response,
|
||||
/// meaning the server already accounted for past reasoning tokens and the
|
||||
/// client should not re-estimate them.
|
||||
|
||||
Reference in New Issue
Block a user