Python SDK 0.154.0
The SDK adds max/ultra reasoning effort, an ExternalMessage type for run() and turn(), new turn-history options, and a required hook metadata migration.
The Codex Python SDK moves to version 0.154.0, installed with pip install --upgrade openai-codex==0.154.0 on Python 3.10 or later, alongside a matching openai-codex-cli-bin==0.154.0 runtime. The release, covered in the changelog, adds two reasoning-effort settings and reworks how external content and turn history are handled.
- Reasoning effort gains two new values, max and ultra.
- Synchronous and asynchronous run() and turn() calls can now take an ExternalMessage. External content can start a turn or join an active one with tool-level authority, though it does not grant user authorization, and it produces its own independent event stream. Handles built manually or attached late only receive events from their attachment point onward, so collected results can be partial, and attaching after a turn has finished can raise a TransportClosedError; thread.read(include_turns=True) returns the full saved history instead.
- resume and fork gain an include_turns option, a newly started turn can get a turn_service_tier, and source metadata is now included. Which history is selected changes what the response returns, not the model's own context, and omitting these options keeps the existing defaults.
- Generated protocol models and notifications have been refreshed, and completion events that arrive before a turn-start response are now preserved instead of lost.
Two migration steps apply when upgrading: HookMetadata now wraps its handler in .root, so code reading hook.command should read hook.root.command instead (checking hook.root.handler_type first), and some previously-unrecognised notifications now carry typed payloads, so their named fields should be read directly rather than through .params. Custom codex_bin overrides need CLI 0.151.0 or newer to use ExternalMessage and the new history and per-turn options.
