mirror of
https://github.com/openai/codex.git
synced 2026-04-30 11:21:34 +03:00
python-sdk: clarify initialize metadata and async entrypoint (2026-03-16)
Normalize validated initialize metadata back onto InitializeResponse so successful metadata access exposes populated serverInfo fields even when they were derived from userAgent. Also make async lifecycle guidance explicit in the public surface by documenting async with AsyncCodex() as the preferred entrypoint and aligning the AsyncCodex metadata error message with that model. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -17,6 +17,9 @@ Choose `run()` for most apps. Choose `stream()` for progress UIs, custom timeout
|
||||
|
||||
- `Codex` is the sync public API.
|
||||
- `AsyncCodex` is an async replica of the same public API shape.
|
||||
- Prefer `async with AsyncCodex()` for async code. It is the standard path for
|
||||
explicit startup/shutdown, and `AsyncCodex` initializes lazily on context
|
||||
entry or first awaited API use.
|
||||
|
||||
If your app is not already async, stay with `Codex`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user