mirror of
https://github.com/openai/codex.git
synced 2026-10-19 17:28:46 +00:00
Add opt-in structured errors for Guardian circuit-breaker interruptions (#48796)
## Why Guardian denial-limit interruptions lack a structured error identifying the cause. Make this opt-in because older clients may not recognize the new error in shared history. ## What changed - Add `auto_review.circuit_break_action = "strict"` to attach `TooManyDenials` to the interrupted turn. The default leaves the error unset. - Expose `turn.error.codexErrorInfo = "tooManyDenials"` in app-server notifications and saved history, and update protocol schemas and generated types. - Preserve the warning, denial limit, and interrupted status without emitting a separate error notification. ## Testing Add an integration test covering omitted, `default`, and `strict` settings, checking warnings, live turn errors, the absence of separate error notifications, and persisted turn errors after restart. GitOrigin-RevId: cb5d379e64728d4d7b9daf834c13756e4a70db31
This commit is contained in:
@@ -547,6 +547,7 @@ class CodexErrorInfoValue(Enum):
|
||||
server_overloaded = "serverOverloaded"
|
||||
cyber_policy = "cyberPolicy"
|
||||
misalignment_policy_violation = "misalignmentPolicyViolation"
|
||||
too_many_denials = "tooManyDenials"
|
||||
internal_server_error = "internalServerError"
|
||||
unauthorized = "unauthorized"
|
||||
bad_request = "badRequest"
|
||||
@@ -11473,7 +11474,7 @@ class Turn(BaseModel):
|
||||
),
|
||||
] = None
|
||||
error: Annotated[
|
||||
TurnError | None, Field(description="Only populated when the Turn's status is failed.")
|
||||
TurnError | None, Field(description="Error associated with a failed or interrupted turn.")
|
||||
] = None
|
||||
id: Annotated[
|
||||
str, Field(description="Identifier for this turn. Codex-generated turn IDs are UUIDv7.")
|
||||
|
||||
Reference in New Issue
Block a user