mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
Expose bioPolicy errors in app-server v2 (#62176)
## Why App-server clients received the generic `other` error code for biology policy errors, so they couldn't distinguish them by code. ## What changed Map the core `BioPolicy` error to `bioPolicy` in app-server v2 and include the new value in the generated JSON schemas, TypeScript types, and Python SDK enum. ## Testing Update the error conversion test to assert that `BioPolicy` serializes as `"bioPolicy"`. GitOrigin-RevId: 77fa969a3d8cbd4c12fe6f7aa5d4833f6adaa99b
This commit is contained in:
@@ -86,6 +86,7 @@ pub enum CodexErrorInfo {
|
||||
/// The workspace's inference hook explicitly denied this request.
|
||||
InferenceHookDenied,
|
||||
CyberPolicy,
|
||||
BioPolicy,
|
||||
MisalignmentPolicyViolation,
|
||||
TooManyDenials,
|
||||
HttpConnectionFailed {
|
||||
@@ -166,7 +167,7 @@ impl From<CoreCodexErrorInfo> for CodexErrorInfo {
|
||||
}
|
||||
CoreCodexErrorInfo::CyberPolicy => CodexErrorInfo::CyberPolicy,
|
||||
CoreCodexErrorInfo::InferenceHookDenied => CodexErrorInfo::InferenceHookDenied,
|
||||
CoreCodexErrorInfo::BioPolicy => CodexErrorInfo::Other,
|
||||
CoreCodexErrorInfo::BioPolicy => CodexErrorInfo::BioPolicy,
|
||||
CoreCodexErrorInfo::MisalignmentPolicyViolation => {
|
||||
CodexErrorInfo::MisalignmentPolicyViolation
|
||||
}
|
||||
|
||||
@@ -4966,7 +4966,7 @@ fn core_error_info_converts_to_camel_case() {
|
||||
CoreCodexErrorInfo::InferenceHookDenied,
|
||||
json!("inferenceHookDenied"),
|
||||
),
|
||||
(CoreCodexErrorInfo::BioPolicy, json!("other")),
|
||||
(CoreCodexErrorInfo::BioPolicy, json!("bioPolicy")),
|
||||
(CoreCodexErrorInfo::InvalidPrompt, json!("other")),
|
||||
(
|
||||
CoreCodexErrorInfo::FlexUnavailable,
|
||||
|
||||
Reference in New Issue
Block a user