mirror of
https://github.com/openai/codex.git
synced 2026-04-26 07:35:29 +00: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:
@@ -62,6 +62,16 @@ with Codex() as codex:
|
||||
AsyncCodex(config: AppServerConfig | None = None)
|
||||
```
|
||||
|
||||
Preferred usage:
|
||||
|
||||
```python
|
||||
async with AsyncCodex() as codex:
|
||||
...
|
||||
```
|
||||
|
||||
`AsyncCodex` initializes lazily. Context entry is the standard path because it
|
||||
ensures startup and shutdown are paired explicitly.
|
||||
|
||||
Properties/methods:
|
||||
|
||||
- `metadata -> InitializeResponse`
|
||||
|
||||
Reference in New Issue
Block a user