Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sdk/python/examples/13_model_select_and_turn_params/async.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"medium": 3,
"high": 4,
"xhigh": 5,
"max": 6,
"ultra": 7,
}


Expand Down
2 changes: 2 additions & 0 deletions sdk/python/examples/13_model_select_and_turn_params/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"medium": 3,
"high": 4,
"xhigh": 5,
"max": 6,
"ultra": 7,
}


Expand Down
2 changes: 2 additions & 0 deletions sdk/python/scripts/update_sdk_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,8 @@ def _preserve_reasoning_effort_enum(out_path: Path) -> None:
medium = "medium"
high = "high"
xhigh = "xhigh"
max = "max"
ultra = "ultra"

@classmethod
def _missing_(cls, value: object) -> ReasoningEffort | None:
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/src/openai_codex/generated/v2_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -3208,6 +3208,8 @@ class ReasoningEffort(str, Enum):
medium = "medium"
high = "high"
xhigh = "xhigh"
max = "max"
ultra = "ultra"

@classmethod
def _missing_(cls, value: object) -> ReasoningEffort | None:
Expand Down
18 changes: 13 additions & 5 deletions sdk/python/tests/test_client_rpc_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from pathlib import Path

import pytest

from openai_codex.client import CodexClient, _params_dict
from openai_codex.generated.notification_registry import notification_turn_id
from openai_codex.generated.v2_all import (
Expand Down Expand Up @@ -73,18 +75,24 @@ def test_plan_type_accepts_business_prolite_from_newer_runtime() -> None:
assert rate_limits_updated.payload.rate_limits.plan_type == PlanType(plan_type)


def test_reasoning_effort_preserves_enum_constants_and_accepts_future_values() -> None:
@pytest.mark.parametrize(
("effort", "wire_value"),
[(ReasoningEffort.max, "max"), (ReasoningEffort.ultra, "ultra")],
)
def test_reasoning_effort_preserves_enum_constants_and_accepts_future_values(
effort: ReasoningEffort, wire_value: str
) -> None:
"""Known effort members and new runtime values should share the enum-style API."""
known_option = ReasoningEffortOption.model_validate(
{"description": "Balanced", "reasoningEffort": "medium"}
)
future_option = ReasoningEffortOption.model_validate(
{"description": "Future", "reasoningEffort": "ultra"}
{"description": "Future", "reasoningEffort": "future"}
)
turn_params = TurnStartParams(
thread_id="thread-1",
input=[],
effort=ReasoningEffort.medium,
effort=effort,
)

assert {
Expand All @@ -95,8 +103,8 @@ def test_reasoning_effort_preserves_enum_constants_and_accepts_future_values() -
} == {
"known_member": "medium",
"known_option": "medium",
"future_option": "ultra",
"turn_effort": "medium",
"future_option": "future",
"turn_effort": wire_value,
}


Expand Down
9 changes: 8 additions & 1 deletion sdk/typescript/src/threadOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ export type ApprovalMode = "never" | "on-request" | "on-failure" | "untrusted";

export type SandboxMode = "read-only" | "workspace-write" | "danger-full-access";

export type ModelReasoningEffort = "minimal" | "low" | "medium" | "high" | "xhigh";
export type ModelReasoningEffort =
| "minimal"
| "low"
| "medium"
| "high"
| "xhigh"
| "max"
| "ultra";

export type WebSearchMode = "disabled" | "cached" | "live";

Expand Down
Loading