mirror of
https://github.com/openai/codex.git
synced 2026-09-28 08:43:01 +08:00
Prepare Python SDK 0.147.0 stable release (#39155)
## What changed - Pin `openai-codex` to the `0.147.0` CLI runtime and regenerate its protocol models and lockfile. - Allow stable Python SDK release tags and require their versions to match the pinned runtime. - Expose the regenerated API additions, including thread sections, environment connection notifications, audio inputs, and the `section_id` thread-list filter. ## Testing - Update release staging, generated-contract, notification, and public-signature coverage for the new runtime. GitOrigin-RevId: 8b99ef6781e01c34d9d697c8c44247fb4e4fe3ab
This commit is contained in:
@@ -38,10 +38,10 @@ jobs:
|
||||
from pathlib import Path
|
||||
|
||||
sdk_version = os.environ["GITHUB_REF_NAME"].removeprefix("python-v")
|
||||
if not re.fullmatch(r"[0-9]+\.[0-9]+\.[0-9]+b[0-9]+", sdk_version):
|
||||
if not re.fullmatch(r"[0-9]+\.[0-9]+\.[0-9]+(?:b[0-9]+)?", sdk_version):
|
||||
raise SystemExit(
|
||||
"Python SDK release tags must identify a beta release, "
|
||||
"for example python-v0.1.0b1."
|
||||
"Python SDK release tags must identify a stable or beta release, "
|
||||
"for example python-v0.147.0 or python-v0.1.0b1."
|
||||
)
|
||||
|
||||
pyproject = tomllib.loads(Path("sdk/python/pyproject.toml").read_text())
|
||||
@@ -56,6 +56,11 @@ jobs:
|
||||
f"Expected exactly one pinned {prefix} dependency, found {runtime_versions}"
|
||||
)
|
||||
|
||||
if "b" not in sdk_version and sdk_version != runtime_versions[0]:
|
||||
raise SystemExit(
|
||||
f"Stable SDK version {sdk_version} must match pinned runtime {runtime_versions[0]}."
|
||||
)
|
||||
|
||||
with Path(os.environ["GITHUB_OUTPUT"]).open("a") as output:
|
||||
print(f"runtime_version={runtime_versions[0]}", file=output)
|
||||
print(f"sdk_version={sdk_version}", file=output)
|
||||
|
||||
@@ -16,7 +16,7 @@ classifiers = [
|
||||
"Intended Audience :: Developers",
|
||||
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||
]
|
||||
dependencies = ["pydantic>=2.12", "openai-codex-cli-bin==0.144.4"]
|
||||
dependencies = ["pydantic>=2.12", "openai-codex-cli-bin==0.147.0"]
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/openai/codex"
|
||||
@@ -65,10 +65,10 @@ combine-as-imports = true
|
||||
|
||||
[tool.uv]
|
||||
exclude-newer = "7 days"
|
||||
exclude-newer-package = { openai-codex-cli-bin = "2026-07-15T01:00:00Z" }
|
||||
exclude-newer-package = { openai-codex-cli-bin = "2026-08-19T00:00:00Z" }
|
||||
index-strategy = "first-index"
|
||||
|
||||
[tool.uv.pip]
|
||||
exclude-newer = "7 days"
|
||||
exclude-newer-package = { openai-codex-cli-bin = "2026-07-15T01:00:00Z" }
|
||||
exclude-newer-package = { openai-codex-cli-bin = "2026-08-19T00:00:00Z" }
|
||||
index-strategy = "first-index"
|
||||
|
||||
@@ -178,6 +178,7 @@ class Codex:
|
||||
limit: int | None = None,
|
||||
model_providers: list[str] | None = None,
|
||||
search_term: str | None = None,
|
||||
section_id: str | None = None,
|
||||
sort_direction: SortDirection | None = None,
|
||||
sort_key: ThreadSortKey | None = None,
|
||||
source_kinds: list[ThreadSourceKind] | None = None,
|
||||
@@ -191,6 +192,7 @@ class Codex:
|
||||
limit=limit,
|
||||
model_providers=model_providers,
|
||||
search_term=search_term,
|
||||
section_id=section_id,
|
||||
sort_direction=sort_direction,
|
||||
sort_key=sort_key,
|
||||
source_kinds=source_kinds,
|
||||
@@ -419,6 +421,7 @@ class AsyncCodex:
|
||||
limit: int | None = None,
|
||||
model_providers: list[str] | None = None,
|
||||
search_term: str | None = None,
|
||||
section_id: str | None = None,
|
||||
sort_direction: SortDirection | None = None,
|
||||
sort_key: ThreadSortKey | None = None,
|
||||
source_kinds: list[ThreadSourceKind] | None = None,
|
||||
@@ -433,6 +436,7 @@ class AsyncCodex:
|
||||
limit=limit,
|
||||
model_providers=model_providers,
|
||||
search_term=search_term,
|
||||
section_id=section_id,
|
||||
sort_direction=sort_direction,
|
||||
sort_key=sort_key,
|
||||
source_kinds=source_kinds,
|
||||
|
||||
@@ -15,6 +15,7 @@ from .v2_all import CommandExecutionOutputDeltaNotification
|
||||
from .v2_all import ConfigWarningNotification
|
||||
from .v2_all import ContextCompactedNotification
|
||||
from .v2_all import DeprecationNoticeNotification
|
||||
from .v2_all import EnvironmentConnectionNotification
|
||||
from .v2_all import ErrorNotification
|
||||
from .v2_all import ExternalAgentConfigImportCompletedNotification
|
||||
from .v2_all import ExternalAgentConfigImportProgressNotification
|
||||
@@ -119,6 +120,8 @@ NOTIFICATION_MODELS: dict[str, type[BaseModel]] = {
|
||||
"thread/closed": ThreadClosedNotification,
|
||||
"thread/compacted": ContextCompactedNotification,
|
||||
"thread/deleted": ThreadDeletedNotification,
|
||||
"thread/environment/connected": EnvironmentConnectionNotification,
|
||||
"thread/environment/disconnected": EnvironmentConnectionNotification,
|
||||
"thread/goal/cleared": ThreadGoalClearedNotification,
|
||||
"thread/goal/updated": ThreadGoalUpdatedNotification,
|
||||
"thread/name/updated": ThreadNameUpdatedNotification,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -96,6 +96,7 @@ def test_run_params_and_usage_cross_app_server_boundary(tmp_path) -> None:
|
||||
"request_model": "mock-model-override",
|
||||
"usage": {
|
||||
"last": {
|
||||
"cacheWriteInputTokens": 0,
|
||||
"cachedInputTokens": 3,
|
||||
"inputTokens": 11,
|
||||
"outputTokens": 7,
|
||||
@@ -103,6 +104,7 @@ def test_run_params_and_usage_cross_app_server_boundary(tmp_path) -> None:
|
||||
"totalTokens": 18,
|
||||
},
|
||||
"total": {
|
||||
"cacheWriteInputTokens": 0,
|
||||
"cachedInputTokens": 3,
|
||||
"inputTokens": 11,
|
||||
"outputTokens": 7,
|
||||
|
||||
@@ -377,17 +377,17 @@ def test_schema_normalization_only_flattens_string_literal_oneofs(
|
||||
if isinstance(definition, dict) and script._flatten_string_enum_one_of(definition.copy())
|
||||
]
|
||||
|
||||
assert flattened == [
|
||||
"MessagePhase",
|
||||
"TurnItemsView",
|
||||
assert sorted(flattened) == [
|
||||
"AuthMode",
|
||||
"PluginAvailability",
|
||||
"InputModality",
|
||||
"ExperimentalFeatureStage",
|
||||
"ProcessOutputStream",
|
||||
"AutoCompactTokenLimitScope",
|
||||
"CommandExecOutputStream",
|
||||
"ConsumeAccountRateLimitResetCreditOutcome",
|
||||
"AutoCompactTokenLimitScope",
|
||||
"ExperimentalFeatureStage",
|
||||
"InputModality",
|
||||
"MessagePhase",
|
||||
"PluginAvailability",
|
||||
"ProcessOutputStream",
|
||||
"TurnItemsView",
|
||||
]
|
||||
|
||||
|
||||
@@ -515,10 +515,10 @@ def test_source_sdk_template_pins_published_runtime() -> None:
|
||||
"dependencies": pyproject["project"]["dependencies"],
|
||||
} == {
|
||||
"sdk_template_version": "0.0.0-dev",
|
||||
"runtime_pin": "0.144.4",
|
||||
"runtime_pin": "0.147.0",
|
||||
"dependencies": [
|
||||
"pydantic>=2.12",
|
||||
"openai-codex-cli-bin==0.144.4",
|
||||
"openai-codex-cli-bin==0.147.0",
|
||||
],
|
||||
}
|
||||
|
||||
@@ -592,7 +592,7 @@ def test_runtime_setup_reads_independent_runtime_pin_and_release_tags() -> None:
|
||||
} == {
|
||||
"package_name": "openai-codex-cli-bin",
|
||||
"sdk_template_version": "0.0.0-dev",
|
||||
"runtime_pin": "0.144.4",
|
||||
"runtime_pin": "0.147.0",
|
||||
"normalized_release_version": "0.116.0a1",
|
||||
"normalized_alpha_hotfix_version": "0.116.0a1.post2",
|
||||
"release_tag": "rust-v0.116.0-alpha.1",
|
||||
@@ -841,7 +841,7 @@ def test_stage_sdk_release_preserves_reviewed_runtime_pin(tmp_path: Path) -> Non
|
||||
script = _load_update_script_module()
|
||||
staged = script.stage_python_sdk_package(
|
||||
tmp_path / "sdk-stage",
|
||||
"0.144.4",
|
||||
"0.147.0",
|
||||
)
|
||||
|
||||
pyproject = tomllib.loads((staged / "pyproject.toml").read_text())
|
||||
@@ -851,18 +851,18 @@ def test_stage_sdk_release_preserves_reviewed_runtime_pin(tmp_path: Path) -> Non
|
||||
"dependencies": pyproject["project"]["dependencies"],
|
||||
} == {
|
||||
"name": "openai-codex",
|
||||
"version": "0.144.4",
|
||||
"version": "0.147.0",
|
||||
"dependencies": [
|
||||
"pydantic>=2.12",
|
||||
"openai-codex-cli-bin==0.144.4",
|
||||
"openai-codex-cli-bin==0.147.0",
|
||||
],
|
||||
}
|
||||
assert (
|
||||
'__version__ = "0.144.4"'
|
||||
'__version__ = "0.147.0"'
|
||||
not in (staged / "src" / "openai_codex" / "__init__.py").read_text()
|
||||
)
|
||||
assert (
|
||||
'client_version: str = "0.144.4"'
|
||||
'client_version: str = "0.147.0"'
|
||||
not in (staged / "src" / "openai_codex" / "client.py").read_text()
|
||||
)
|
||||
assert not any((staged / "src" / "openai_codex").glob("bin/**"))
|
||||
@@ -875,7 +875,7 @@ def test_stage_sdk_release_replaces_existing_staging_dir(tmp_path: Path) -> None
|
||||
old_file.parent.mkdir(parents=True)
|
||||
old_file.write_text("stale")
|
||||
|
||||
staged = script.stage_python_sdk_package(staging_dir, "0.144.4")
|
||||
staged = script.stage_python_sdk_package(staging_dir, "0.147.0")
|
||||
|
||||
assert staged == staging_dir
|
||||
assert not old_file.exists()
|
||||
@@ -887,11 +887,11 @@ def test_sdk_release_matches_stable_runtime(tmp_path: Path) -> None:
|
||||
|
||||
sdk_stage = script.stage_python_sdk_package(
|
||||
tmp_path / "sdk-stage",
|
||||
"0.144.4",
|
||||
"0.147.0",
|
||||
)
|
||||
runtime_stage = script.stage_python_runtime_package(
|
||||
tmp_path / "runtime-stage",
|
||||
"0.144.4",
|
||||
"0.147.0",
|
||||
package_archive,
|
||||
)
|
||||
|
||||
@@ -903,11 +903,11 @@ def test_sdk_release_matches_stable_runtime(tmp_path: Path) -> None:
|
||||
"runtime_version": runtime_pyproject["project"]["version"],
|
||||
"sdk_dependencies": sdk_pyproject["project"]["dependencies"],
|
||||
} == {
|
||||
"sdk_version": "0.144.4",
|
||||
"runtime_version": "0.144.4",
|
||||
"sdk_version": "0.147.0",
|
||||
"runtime_version": "0.147.0",
|
||||
"sdk_dependencies": [
|
||||
"pydantic>=2.12",
|
||||
"openai-codex-cli-bin==0.144.4",
|
||||
"openai-codex-cli-bin==0.147.0",
|
||||
],
|
||||
}
|
||||
|
||||
@@ -920,7 +920,7 @@ def test_stage_sdk_runs_type_generation_before_staging(tmp_path: Path) -> None:
|
||||
"stage-sdk",
|
||||
str(tmp_path / "sdk-stage"),
|
||||
"--sdk-version",
|
||||
"0.144.4",
|
||||
"0.147.0",
|
||||
]
|
||||
)
|
||||
|
||||
@@ -951,7 +951,7 @@ def test_stage_sdk_runs_type_generation_before_staging(tmp_path: Path) -> None:
|
||||
|
||||
script.run_command(args, ops)
|
||||
|
||||
assert calls == ["generate_types", "stage_sdk:0.144.4"]
|
||||
assert calls == ["generate_types", "stage_sdk:0.147.0"]
|
||||
|
||||
|
||||
def test_stage_runtime_stages_package_without_type_generation(tmp_path: Path) -> None:
|
||||
|
||||
@@ -40,7 +40,7 @@ def test_generated_files_are_up_to_date():
|
||||
|
||||
# Regenerate contract artifacts via the pinned runtime package, not a local
|
||||
# app-server binary from the checkout or CI environment.
|
||||
assert importlib.metadata.version("openai-codex-cli-bin") == "0.144.4"
|
||||
assert importlib.metadata.version("openai-codex-cli-bin") == "0.147.0"
|
||||
env = os.environ.copy()
|
||||
env.pop("CODEX_EXEC_PATH", None)
|
||||
python_bin = str(Path(sys.executable).parent)
|
||||
|
||||
@@ -339,6 +339,7 @@ def test_generated_public_signatures_are_snake_case_and_typed() -> None:
|
||||
"limit",
|
||||
"model_providers",
|
||||
"search_term",
|
||||
"section_id",
|
||||
"sort_direction",
|
||||
"sort_key",
|
||||
"source_kinds",
|
||||
@@ -414,6 +415,7 @@ def test_generated_public_signatures_are_snake_case_and_typed() -> None:
|
||||
"limit",
|
||||
"model_providers",
|
||||
"search_term",
|
||||
"section_id",
|
||||
"sort_direction",
|
||||
"sort_key",
|
||||
"source_kinds",
|
||||
|
||||
Generated
+12
-12
@@ -7,7 +7,7 @@ exclude-newer = "0001-01-01T00:00:00Z" # This has no effect and is included for
|
||||
exclude-newer-span = "P7D"
|
||||
|
||||
[options.exclude-newer-package]
|
||||
openai-codex-cli-bin = "2026-07-15T01:00:00Z"
|
||||
openai-codex-cli-bin = "2026-08-19T00:00:00Z"
|
||||
|
||||
[[package]]
|
||||
name = "annotated-types"
|
||||
@@ -118,7 +118,7 @@ name = "exceptiongroup"
|
||||
version = "1.3.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "typing-extensions", marker = "python_full_version < '3.13'" },
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" }
|
||||
wheels = [
|
||||
@@ -306,7 +306,7 @@ test = [
|
||||
|
||||
[package.metadata]
|
||||
requires-dist = [
|
||||
{ name = "openai-codex-cli-bin", specifier = "==0.144.4" },
|
||||
{ name = "openai-codex-cli-bin", specifier = "==0.147.0" },
|
||||
{ name = "pydantic", specifier = ">=2.12" },
|
||||
]
|
||||
|
||||
@@ -325,17 +325,17 @@ test = [
|
||||
|
||||
[[package]]
|
||||
name = "openai-codex-cli-bin"
|
||||
version = "0.144.4"
|
||||
version = "0.147.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/79/30/7e457c007a32aa7333a78438a9f532504c3b77a1ea57e7808855712c2c0f/openai_codex_cli_bin-0.144.4-py3-none-macosx_10_9_x86_64.whl", hash = "sha256:4d587d152d5f0aa25f21ded4d08aac5150da48639b29fc3e57b2a8b413d06903", size = 126851183, upload-time = "2026-07-15T00:14:00.171Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/65/eb/64c180514a2cc3e2500e486813f5a8d7f7e349342e9bebd78d99ddd9791a/openai_codex_cli_bin-0.144.4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:05db505a9c7f020f58b70837a94e00d32a50086986c267bcc44ea97b573d4a05", size = 116474758, upload-time = "2026-07-15T00:14:08.177Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/85/34/921ab692c7ed140941a91e39b84c6deafddb45072793f3a5f6dcbf86f59a/openai_codex_cli_bin-0.144.4-py3-none-manylinux_2_17_aarch64.whl", hash = "sha256:cd4bb31b8a477a3adba22139c8c493693fa5292ba21e86eef08ace3e96c41294", size = 119437596, upload-time = "2026-07-15T00:14:17.418Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/25/62/39e630cf8b7b2e2444a5a6669235a6cd88004869a25bb7f3f629ed35638c/openai_codex_cli_bin-0.144.4-py3-none-manylinux_2_17_x86_64.whl", hash = "sha256:4106229c38f37245c3eea8d904426afd45b8bf19831765715647f5402f757c06", size = 128817757, upload-time = "2026-07-15T00:14:30.539Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/23/24/318f91a95baaff845307e529d138d42a7202e6bd0e626556058eab3dead5/openai_codex_cli_bin-0.144.4-py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:d2d3fada11731938e3d3e3660819d5324b7f92e825a0ed5aede63100b36ffc9a", size = 119437594, upload-time = "2026-07-15T00:14:39.327Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2e/a0/65e6fd3a6fba52639937801d9ce517b0c48026458723bb9f08eb07a1dd35/openai_codex_cli_bin-0.144.4-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:70fb62ed7755e332dd8b00ed48e22ee16df10f4a977335039e237cd330490df3", size = 128817755, upload-time = "2026-07-15T00:14:47.849Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e3/8a/3ab5fc97352e8f780d472c8dd6d7504d6a670cd7dede106d461ac1171999/openai_codex_cli_bin-0.144.4-py3-none-win_amd64.whl", hash = "sha256:56e142974467332f1f669b89f2636e06b3ada09413512abb2f24c33b4a4f59fc", size = 140595092, upload-time = "2026-07-15T00:14:58.484Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/70/1a/3aa52ab8f89e0f596b6eea835e3f3494697da51917d3231f5f48f92e2bcb/openai_codex_cli_bin-0.144.4-py3-none-win_arm64.whl", hash = "sha256:2ad01058db7181323ae7c6217e560702e38c4f107595b99ab1d0abc9f184890a", size = 130665105, upload-time = "2026-07-15T00:15:08.861Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/46/85/3302e5265f35941a24f614573e1a27e6f218d7fa71e4dd3b1353d1726c5a/openai_codex_cli_bin-0.147.0-py3-none-macosx_10_9_x86_64.whl", hash = "sha256:19c3a72a0eac6706bb5023088ab7eb31d8cfc06bf7860250b5c5b90f4505489b", size = 116948927, upload-time = "2026-08-18T06:05:53.479Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b8/0c/6474ef2f854ecf217550d06667a8ac988b5656c448b680e5b5ece5ae5152/openai_codex_cli_bin-0.147.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:b851943fffc48aa7c5c130b6a34be09964833d2785546eda96d749427c6e24f2", size = 107573930, upload-time = "2026-08-18T06:05:57.701Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/59/4b/0efce457a301271301b9229b36b3f53ca94d5f4db1d605c86e0da9833565/openai_codex_cli_bin-0.147.0-py3-none-manylinux_2_17_aarch64.whl", hash = "sha256:aab3e27ce07cd7bc7a78708efa40375b28e89f586851c495ef55aa6cb6806d11", size = 111220520, upload-time = "2026-08-18T06:06:01.636Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f2/e4/5e4fb0f61ca90c2bb42a8823e08fe05957c54591d1e161c56a93d27d565d/openai_codex_cli_bin-0.147.0-py3-none-manylinux_2_17_x86_64.whl", hash = "sha256:cb3907d633cda87c4b68b47ff4979e6054c02a08c41b15aa2e9a689558a61074", size = 119921665, upload-time = "2026-08-18T06:06:05.666Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f9/83/a52e32fc63bde10996e38cb4e1175c402c578ee7c7ca79b96abee5219127/openai_codex_cli_bin-0.147.0-py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:ea0bfdee98164fc7d589eea5623aff06c8f8f2ba3f9bc550297429db45ea68f7", size = 111220518, upload-time = "2026-08-18T06:06:09.538Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e9/b6/c159da0a1ec136fde6d2742ec05347e311f000dfe19024ed7d708cf60aa5/openai_codex_cli_bin-0.147.0-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:a9be23f46326494b7ebf4bd98cbe985542f5ad076355f3b0fb636a984df56816", size = 119921665, upload-time = "2026-08-18T06:06:15.061Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/54/38/1bb47e08b9c523b673358e4f5597fc99699e855ec63bd02fdc157f1679c9/openai_codex_cli_bin-0.147.0-py3-none-win_amd64.whl", hash = "sha256:1a403ff803ae27e078189a0fd24687f32d43c46f152e50cdbe3eddc9e302f697", size = 127586208, upload-time = "2026-08-18T06:06:19.395Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d2/1e/a44a8da140ef080aebac6da6517e8fe6ac1aad49436c8b1f9b87e735b813/openai_codex_cli_bin-0.147.0-py3-none-win_arm64.whl", hash = "sha256:be0c8b9e34b067151d0964a24e9f4b8b48ea516448a08ef2636f357ebdc877b7", size = 117863410, upload-time = "2026-08-18T06:06:23.554Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
Reference in New Issue
Block a user