mirror of
https://github.com/openai/codex.git
synced 2026-11-20 22:40:37 +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
@@ -328,6 +328,43 @@ def test_generated_v2_bundle_has_single_shared_plan_type_definition() -> None:
|
||||
assert source.count("class PlanType(") == 1
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"availability",
|
||||
[None, "available", "enrollmentRequired", "unavailableForModel", "default", "futureStatus"],
|
||||
)
|
||||
def test_model_list_preserves_daybreak_availability_from_older_and_newer_hosts(
|
||||
monkeypatch: pytest.MonkeyPatch, availability: str | None
|
||||
) -> None:
|
||||
access_programs: JsonObject = {"cyber": ["standard", "daybreakBlue", "daybreakRed"]}
|
||||
if availability is not None:
|
||||
access_programs["daybreakAvailability"] = availability
|
||||
wire = {
|
||||
"data": [
|
||||
{
|
||||
"id": "model-id",
|
||||
"model": "model-id",
|
||||
"displayName": "Model",
|
||||
"description": "A caller-visible model",
|
||||
"hidden": False,
|
||||
"isDefault": False,
|
||||
"defaultReasoningEffort": "medium",
|
||||
"supportedReasoningEfforts": [],
|
||||
"availableAccessPrograms": access_programs,
|
||||
}
|
||||
],
|
||||
"nextCursor": None,
|
||||
}
|
||||
client = CodexClient()
|
||||
monkeypatch.setattr(client, "_request_raw", lambda _method, _params: wire)
|
||||
|
||||
response = client.model_list()
|
||||
|
||||
assert response.model_dump(mode="json", by_alias=True, exclude_unset=True) == wire
|
||||
programs = response.data[0].available_access_programs
|
||||
assert programs is not None
|
||||
assert programs.daybreak_availability == (availability or "default")
|
||||
|
||||
|
||||
def test_plan_type_accepts_business_prolite_from_newer_runtime() -> None:
|
||||
"""New runtime plan values should remain typed when using a codex_bin override."""
|
||||
plan_type = "self_serve_business_prolite"
|
||||
|
||||
Reference in New Issue
Block a user