OpenAI Codex release notes: Python SDK adds external messages

OpenAI Codex release notes: Python SDK adds external messages

OpenAI Codex Python SDK 0.154.0 can receive content from other agents, tools, and services through ExternalMessage. The message can start a new turn or join an active regular turn. An SDK is a software development kit; this update applies to programs that use Codex from Python.

OpenAI Codex release notes: external messages in Python

The version was released on September 10. Both synchronous and asynchronous run() and turn() support ExternalMessage. The content is treated as tool output, not as a user instruction granting authorization. Each consumer receives an independent event stream.

This lets an integration send a tool result while Codex is working without presenting it as a new assignment from the user.

Source: OpenAI Codex Python SDK 0.154.0 release notes.

Human step: update the Python library

Run OpenAI's installation command in your project's Python environment:

pip install --upgrade openai-codex==0.154.0

You need Python 3.10 or later. The package includes the matching openai-codex-cli-bin==0.154.0 runtime. If you supply your own executable through codex_bin, external messages and the new history and per-turn options require CLI 0.151.0 or newer.

Source: OpenAI: installation and version requirements.

Check these changes when migrating

  • HookMetadata now wraps its handler in .root. Replace accesses such as hook.command with hook.root.command and check hook.root.handler_type before reading fields specific to a handler.
  • Some previously unknown notifications now have typed payloads. Read named fields instead of .params.
  • Manually constructed or late-joining turn handles receive events from their attachment point. Earlier output is not replayed. Use thread.read(include_turns=True) for saved history; attaching after a turn completes can raise TransportClosedError.

The new include_turns option on resume and fork controls history in the returned response, not the model's context. Omitting the options preserves existing defaults.

Source: OpenAI: Python SDK 0.154.0 migration notes.

The Forge newsletter

Get new articles in your inbox

Pick the topics you care about. No noise, at most one email a week.

Get new articles in your inbox

We follow GDPR. Unsubscribe anytime.