Skip to content

[2/8] Generate Python SDK types from pinned runtime#21893

Merged
aibrahim-oai merged 2 commits into
mainfrom
codex/python-sdk-generate-types-from-pinned-runtime
May 11, 2026
Merged

[2/8] Generate Python SDK types from pinned runtime#21893
aibrahim-oai merged 2 commits into
mainfrom
codex/python-sdk-generate-types-from-pinned-runtime

Conversation

@aibrahim-oai
Copy link
Copy Markdown
Collaborator

@aibrahim-oai aibrahim-oai commented May 9, 2026

Why

Once the SDK declares its runtime package, generated Python artifacts should come from that pinned runtime rather than whatever app-server schema happens to be in the current checkout. That keeps the generated API and model surface aligned with the runtime users install.

What

  • Teach scripts/update_sdk_artifacts.py generate-types to invoke the pinned runtime package for schema generation.
  • Regenerate v2_all.py, notification_registry.py, and generated public wrapper methods from that schema.
  • Add freshness coverage so regenerating from the pinned runtime must leave checked-in artifacts unchanged.

Stack

  1. [1/8] Pin Python SDK runtime dependency #21891 [1/8] Pin Python SDK runtime dependency
  2. This PR [2/8] Generate Python SDK types from pinned runtime
  3. [3/8] Run Python SDK tests in CI #21895 [3/8] Run Python SDK tests in CI
  4. [4/8] Define Python SDK public API surface #21896 [4/8] Define Python SDK public API surface
  5. [5/8] Rename Python SDK package to openai-codex #21905 [5/8] Rename Python SDK package to openai-codex
  6. [6/8] Add high-level Python SDK approval mode #21910 [6/8] Add high-level Python SDK approval mode
  7. [7/8] Add Python SDK app-server integration harness #22014 [7/8] Add Python SDK app-server integration harness
  8. [8/8] Add Python SDK Ruff formatting #22021 [8/8] Add Python SDK Ruff formatting

Verification

  • Added test_generated_files_are_up_to_date for pinned-runtime generation drift.
  • Added generator-structure tests for schema annotation and notification metadata generation.

@aibrahim-oai aibrahim-oai changed the title Generate Python SDK types from pinned runtime [2/3] Generate Python SDK types from pinned runtime May 9, 2026
@aibrahim-oai aibrahim-oai force-pushed the codex/python-sdk-pin-runtime-types branch from edf326e to c24694b Compare May 9, 2026 07:24
@aibrahim-oai aibrahim-oai force-pushed the codex/python-sdk-generate-types-from-pinned-runtime branch from 7902536 to 242ca6d Compare May 9, 2026 07:24
@aibrahim-oai aibrahim-oai changed the title [2/3] Generate Python SDK types from pinned runtime [2/4] Generate Python SDK types from pinned runtime May 9, 2026
@aibrahim-oai aibrahim-oai changed the title [2/4] Generate Python SDK types from pinned runtime [2/5] Generate Python SDK types from pinned runtime May 9, 2026
@aibrahim-oai aibrahim-oai changed the title [2/5] Generate Python SDK types from pinned runtime [2/6] Generate Python SDK types from pinned runtime May 9, 2026
@aibrahim-oai aibrahim-oai changed the title [2/6] Generate Python SDK types from pinned runtime [2/7] Generate Python SDK types from pinned runtime May 10, 2026
@aibrahim-oai aibrahim-oai changed the title [2/7] Generate Python SDK types from pinned runtime [2/8] Generate Python SDK types from pinned runtime May 10, 2026
@aibrahim-oai aibrahim-oai force-pushed the codex/python-sdk-pin-runtime-types branch from c24694b to cf7e95f Compare May 11, 2026 21:29
@aibrahim-oai aibrahim-oai force-pushed the codex/python-sdk-generate-types-from-pinned-runtime branch from 242ca6d to de429a1 Compare May 11, 2026 21:29
aibrahim-oai added a commit that referenced this pull request May 11, 2026
## Why

The Python SDK depends on the app-server runtime package for the bundled
`codex` binary and schema source of truth. That relationship should be
explicit in package metadata instead of inferred from matching version
numbers, so installers, lockfiles, and reviewers can see exactly which
runtime the SDK expects.

## What

- Declare `openai-codex-cli-bin==0.131.0a4` as a Python SDK dependency.
- Update runtime setup helpers to resolve the runtime version from the
declared dependency pin.
- Refresh the SDK lockfile for the pinned runtime wheel.
- Update package/runtime tests and docs that describe where the runtime
version comes from.

## Stack

1. This PR `[1/8]` Pin Python SDK runtime dependency
2. #21893 `[2/8]` Generate Python SDK types from pinned runtime
3. #21895 `[3/8]` Run Python SDK tests in CI
4. #21896 `[4/8]` Define Python SDK public API surface
5. #21905 `[5/8]` Rename Python SDK package to `openai-codex`
6. #21910 `[6/8]` Add high-level Python SDK approval mode
7. #22014 `[7/8]` Add Python SDK app-server integration harness
8. #22021 `[8/8]` Add Python SDK Ruff formatting

## Verification

- Added coverage for the SDK runtime dependency pin and runtime
distribution naming.

---------

Co-authored-by: Codex <noreply@openai.com>
Base automatically changed from codex/python-sdk-pin-runtime-types to main May 11, 2026 21:42
@aibrahim-oai aibrahim-oai force-pushed the codex/python-sdk-generate-types-from-pinned-runtime branch from de429a1 to 874b0d0 Compare May 11, 2026 21:48
aibrahim-oai and others added 2 commits May 12, 2026 00:49
Make the SDK artifact generator fetch schema from the pinned runtime package, regenerate the checked-in Python types from that schema, and assert generated artifacts stay up to date.

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
@aibrahim-oai aibrahim-oai force-pushed the codex/python-sdk-generate-types-from-pinned-runtime branch from 874b0d0 to 8fd583a Compare May 11, 2026 21:51
@aibrahim-oai aibrahim-oai merged commit 6a4653e into main May 11, 2026
26 checks passed
@aibrahim-oai aibrahim-oai deleted the codex/python-sdk-generate-types-from-pinned-runtime branch May 11, 2026 21:53
@github-actions github-actions Bot locked and limited conversation to collaborators May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant