mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
Expose Daybreak availability in model discovery (#62499)
## Why Clients need to distinguish a caller who must enroll in Daybreak from a model that does not support it. The list of accepted access programs alone cannot express that distinction. ## What changed Carry the server-resolved status for each caller and model from the model catalog into `model/list` as `availableAccessPrograms.daybreakAvailability`. Update the JSON schemas, TypeScript bindings, and Python SDK to expose the field. Rust decoders use `default` for missing or unrecognized statuses. The Python SDK also defaults missing statuses and preserves new strings from newer hosts. ## Testing Cover catalog decoding, app-server response serialization, and Python SDK round trips with known, missing, and future status values. GitOrigin-RevId: c1e5ddef68fd19b25e583bb6996a93fd78ab9d18
This commit is contained in:
committed by
copyberry
parent
b0ecad9cf9
commit
1826d80eca
+20
-1
@@ -11531,6 +11531,16 @@
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"DaybreakAvailability": {
|
||||
"description": "Server-resolved Daybreak availability for this caller and model.",
|
||||
"enum": [
|
||||
"available",
|
||||
"enrollmentRequired",
|
||||
"unavailableForModel",
|
||||
"default"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"DeprecationNoticeNotification": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
@@ -16783,7 +16793,7 @@
|
||||
"type": "object"
|
||||
},
|
||||
"ModelAccessPrograms": {
|
||||
"description": "Caller-specific explicit access programs advertised by model discovery.",
|
||||
"description": "Caller-specific access programs and Daybreak availability from model discovery.",
|
||||
"properties": {
|
||||
"cyber": {
|
||||
"description": "Accepted explicit selections.",
|
||||
@@ -16791,6 +16801,15 @@
|
||||
"$ref": "#/definitions/v2/CyberAccessProgram"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"daybreakAvailability": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/v2/DaybreakAvailability"
|
||||
}
|
||||
],
|
||||
"default": "default",
|
||||
"description": "Server-resolved Daybreak availability for this caller and model."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
+20
-1
@@ -7285,6 +7285,16 @@
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"DaybreakAvailability": {
|
||||
"description": "Server-resolved Daybreak availability for this caller and model.",
|
||||
"enum": [
|
||||
"available",
|
||||
"enrollmentRequired",
|
||||
"unavailableForModel",
|
||||
"default"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"DeprecationNoticeNotification": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
@@ -12717,7 +12727,7 @@
|
||||
"type": "object"
|
||||
},
|
||||
"ModelAccessPrograms": {
|
||||
"description": "Caller-specific explicit access programs advertised by model discovery.",
|
||||
"description": "Caller-specific access programs and Daybreak availability from model discovery.",
|
||||
"properties": {
|
||||
"cyber": {
|
||||
"description": "Accepted explicit selections.",
|
||||
@@ -12725,6 +12735,15 @@
|
||||
"$ref": "#/definitions/CyberAccessProgram"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"daybreakAvailability": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/DaybreakAvailability"
|
||||
}
|
||||
],
|
||||
"default": "default",
|
||||
"description": "Server-resolved Daybreak availability for this caller and model."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
@@ -10,6 +10,16 @@
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"DaybreakAvailability": {
|
||||
"description": "Server-resolved Daybreak availability for this caller and model.",
|
||||
"enum": [
|
||||
"available",
|
||||
"enrollmentRequired",
|
||||
"unavailableForModel",
|
||||
"default"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"InputModality": {
|
||||
"description": "Canonical user-input modality tags advertised by a model.",
|
||||
"oneOf": [
|
||||
@@ -173,7 +183,7 @@
|
||||
"type": "object"
|
||||
},
|
||||
"ModelAccessPrograms": {
|
||||
"description": "Caller-specific explicit access programs advertised by model discovery.",
|
||||
"description": "Caller-specific access programs and Daybreak availability from model discovery.",
|
||||
"properties": {
|
||||
"cyber": {
|
||||
"description": "Accepted explicit selections.",
|
||||
@@ -181,6 +191,15 @@
|
||||
"$ref": "#/definitions/CyberAccessProgram"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"daybreakAvailability": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/DaybreakAvailability"
|
||||
}
|
||||
],
|
||||
"default": "default",
|
||||
"description": "Server-resolved Daybreak availability for this caller and model."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -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.
|
||||
|
||||
/**
|
||||
* Server-resolved Daybreak availability for this caller and model.
|
||||
*/
|
||||
export type DaybreakAvailability = "available" | "enrollmentRequired" | "unavailableForModel" | "default";
|
||||
@@ -2,12 +2,17 @@
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { CyberAccessProgram } from "./CyberAccessProgram";
|
||||
import type { DaybreakAvailability } from "./DaybreakAvailability";
|
||||
|
||||
/**
|
||||
* Caller-specific explicit access programs advertised by model discovery.
|
||||
* Caller-specific access programs and Daybreak availability from model discovery.
|
||||
*/
|
||||
export type ModelAccessPrograms = {
|
||||
/**
|
||||
* Accepted explicit selections.
|
||||
*/
|
||||
cyber: Array<CyberAccessProgram>, };
|
||||
cyber: Array<CyberAccessProgram>,
|
||||
/**
|
||||
* Server-resolved Daybreak availability for this caller and model.
|
||||
*/
|
||||
daybreakAvailability: DaybreakAvailability, };
|
||||
|
||||
@@ -136,6 +136,7 @@ export type { ContextCompactedNotification } from "./ContextCompactedNotificatio
|
||||
export type { CreditsSnapshot } from "./CreditsSnapshot";
|
||||
export type { CustomGatewaySettingsParams } from "./CustomGatewaySettingsParams";
|
||||
export type { CyberAccessProgram } from "./CyberAccessProgram";
|
||||
export type { DaybreakAvailability } from "./DaybreakAvailability";
|
||||
export type { DeprecationNoticeNotification } from "./DeprecationNoticeNotification";
|
||||
export type { DesktopOnboardingEntrypoint } from "./DesktopOnboardingEntrypoint";
|
||||
export type { DynamicToolCallOutputContentItem } from "./DynamicToolCallOutputContentItem";
|
||||
|
||||
@@ -2,6 +2,7 @@ use super::shared::v2_enum_from_core;
|
||||
use super::turn::CyberAccessProgram;
|
||||
use crate::JsonSchema;
|
||||
use crate::TS;
|
||||
use codex_protocol::openai_models::DaybreakAvailability as CoreDaybreakAvailability;
|
||||
use codex_protocol::openai_models::InputModality;
|
||||
use codex_protocol::openai_models::ModelAccessPrograms as CoreModelAccessPrograms;
|
||||
use codex_protocol::openai_models::ModelAvailabilityNux as CoreModelAvailabilityNux;
|
||||
@@ -90,19 +91,37 @@ pub struct ModelServiceTier {
|
||||
pub description: String,
|
||||
}
|
||||
|
||||
/// Caller-specific explicit access programs advertised by model discovery.
|
||||
v2_enum_from_core!(
|
||||
/// Server-resolved Daybreak availability for this caller and model.
|
||||
#[derive(Default)]
|
||||
#[ts(rename_all = "camelCase")]
|
||||
pub enum DaybreakAvailability from CoreDaybreakAvailability {
|
||||
Available,
|
||||
EnrollmentRequired,
|
||||
UnavailableForModel,
|
||||
#[default]
|
||||
#[serde(other)]
|
||||
Default
|
||||
}
|
||||
);
|
||||
|
||||
/// Caller-specific access programs and Daybreak availability from model discovery.
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ModelAccessPrograms {
|
||||
/// Accepted explicit selections.
|
||||
pub cyber: Vec<CyberAccessProgram>,
|
||||
/// Server-resolved Daybreak availability for this caller and model.
|
||||
#[serde(default)]
|
||||
pub daybreak_availability: DaybreakAvailability,
|
||||
}
|
||||
|
||||
impl From<CoreModelAccessPrograms> for ModelAccessPrograms {
|
||||
fn from(value: CoreModelAccessPrograms) -> Self {
|
||||
Self {
|
||||
cyber: value.cyber.into_iter().map(Into::into).collect(),
|
||||
daybreak_availability: value.daybreak_availability.into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,6 +130,7 @@ impl From<ModelAccessPrograms> for CoreModelAccessPrograms {
|
||||
fn from(value: ModelAccessPrograms) -> Self {
|
||||
Self {
|
||||
cyber: value.cyber.into_iter().map(Into::into).collect(),
|
||||
daybreak_availability: value.daybreak_availability.to_core(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5362,6 +5362,76 @@ fn turn_start_params_preserve_explicit_null_service_tier() {
|
||||
assert_eq!(serialized_without_override.get("serviceTier"), None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn model_access_programs_preserve_availability_across_wire_formats() {
|
||||
use codex_protocol::openai_models::ModelAccessPrograms as CoreModelAccessPrograms;
|
||||
|
||||
for (core_availability, app_server_availability, normalized_availability) in [
|
||||
(json!("available"), json!("available"), json!("available")),
|
||||
(
|
||||
json!("enrollment_required"),
|
||||
json!("enrollmentRequired"),
|
||||
json!("enrollmentRequired"),
|
||||
),
|
||||
(
|
||||
json!("unavailable_for_model"),
|
||||
json!("unavailableForModel"),
|
||||
json!("unavailableForModel"),
|
||||
),
|
||||
(json!("default"), json!("default"), json!("default")),
|
||||
(
|
||||
json!("future_status"),
|
||||
json!("futureStatus"),
|
||||
json!("default"),
|
||||
),
|
||||
] {
|
||||
let core: CoreModelAccessPrograms = serde_json::from_value(json!({
|
||||
"cyber": ["standard", "daybreak_blue", "daybreak_red"],
|
||||
"daybreak_availability": core_availability,
|
||||
}))
|
||||
.expect("catalog availability should deserialize");
|
||||
let app_server: ModelAccessPrograms = serde_json::from_value(json!({
|
||||
"cyber": ["standard", "daybreakBlue", "daybreakRed"],
|
||||
"daybreakAvailability": app_server_availability,
|
||||
}))
|
||||
.expect("app-server availability should deserialize");
|
||||
|
||||
assert_eq!(ModelAccessPrograms::from(core.clone()), app_server);
|
||||
assert_eq!(CoreModelAccessPrograms::from(app_server.clone()), core);
|
||||
assert_eq!(
|
||||
serde_json::to_value(app_server).expect("model access programs should serialize"),
|
||||
json!({
|
||||
"cyber": ["standard", "daybreakBlue", "daybreakRed"],
|
||||
"daybreakAvailability": normalized_availability,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
let legacy_core: CoreModelAccessPrograms = serde_json::from_value(json!({
|
||||
"cyber": ["standard", "daybreak_blue"],
|
||||
}))
|
||||
.expect("old catalog metadata should deserialize");
|
||||
let legacy_app_server: ModelAccessPrograms = serde_json::from_value(json!({
|
||||
"cyber": ["standard", "daybreakBlue"],
|
||||
}))
|
||||
.expect("old app-server metadata should deserialize");
|
||||
assert_eq!(
|
||||
ModelAccessPrograms::from(legacy_core.clone()),
|
||||
legacy_app_server,
|
||||
);
|
||||
assert_eq!(
|
||||
CoreModelAccessPrograms::from(legacy_app_server.clone()),
|
||||
legacy_core
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::to_value(legacy_app_server).expect("legacy programs should serialize"),
|
||||
json!({
|
||||
"cyber": ["standard", "daybreakBlue"],
|
||||
"daybreakAvailability": "default",
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn turn_start_cyber_access_program_uses_separate_wire_formats() {
|
||||
for (app_server_value, core_value) in [
|
||||
|
||||
Reference in New Issue
Block a user