[codex] Rename Python SDK AppServerConfig to CodexConfig (#24800)

## Why

`AppServerConfig` is exported as part of the ergonomic Python SDK
surface and passed to `Codex(...)` and `AsyncCodex(...)`. That name
exposes the underlying app-server transport at the same layer where
users are configuring the Codex client. `CodexConfig` makes the common
callsite read naturally and names the object it configures.

## What changed

- Renamed the public configuration dataclass from `AppServerConfig` to
`CodexConfig`.
- Updated `Codex`, `AsyncCodex`, and the transport clients to accept
`CodexConfig`.
- Updated binary-resolution messages, package exports, docs, examples,
and related coverage to use the new public name.

## API impact

```python
from openai_codex import Codex, CodexConfig

with Codex(config=CodexConfig(codex_bin="/path/to/codex")) as codex:
    ...
```

Callers should now import and construct `CodexConfig`; `AppServerConfig`
is no longer part of the Python SDK surface.

## Validation

- `uv run --frozen --extra dev ruff check src/openai_codex scripts
examples tests`
- Tests are deferred to online CI for this PR.
This commit is contained in:
Ahmed Ibrahim
2026-05-27 16:10:15 -07:00
committed by GitHub
Unverified
parent 090144e0ec
commit 0db49a7e6a
22 changed files with 127 additions and 126 deletions
+7 -6
View File
@@ -1,6 +1,6 @@
# OpenAI Codex SDK — API Reference
Public surface of `openai_codex` for app-server v2.
Public surface of `openai_codex` for Codex workflows.
This SDK surface is experimental. Turn streams are routed by turn ID so one client can consume multiple active turns concurrently.
Thread starts default to `ApprovalMode.auto_review`; turn starts accept an optional `approval_mode` override.
@@ -11,6 +11,7 @@ Thread starts default to `ApprovalMode.auto_review`; turn starts accept an optio
from openai_codex import (
Codex,
AsyncCodex,
CodexConfig,
ApprovalMode,
Sandbox,
ChatgptLoginHandle,
@@ -47,12 +48,12 @@ from openai_codex.types import (
- Version: `openai_codex.__version__`
- Requires Python >= 3.10
- Public app-server value and event types live in `openai_codex.types`
- Public Codex protocol value and event types live in `openai_codex.types`
## Codex (sync)
```python
Codex(config: AppServerConfig | None = None)
Codex(config: CodexConfig | None = None)
```
Properties/methods:
@@ -82,7 +83,7 @@ with Codex() as codex:
## AsyncCodex (async parity)
```python
AsyncCodex(config: AppServerConfig | None = None)
AsyncCodex(config: CodexConfig | None = None)
```
Preferred usage:
@@ -201,7 +202,7 @@ Presets:
- `Sandbox.workspace_write`: the normal default for projects with a recorded trust decision; read files and write inside the workspace and configured writable roots.
- `Sandbox.full_access`: run without filesystem access restrictions.
When `sandbox=` is omitted, app-server uses its configured default. A sandbox
When `sandbox=` is omitted, Codex uses its configured default. A sandbox
passed to `run(...)` or `turn(...)` applies to that turn and subsequent turns.
## TurnHandle / AsyncTurnHandle
@@ -249,7 +250,7 @@ Use a plain `str` as shorthand for `TextInput(...)` anywhere a turn input is acc
## Public Types
The SDK wrappers return and accept public app-server models wherever possible:
The SDK wrappers return and accept public Codex protocol models wherever possible:
```python
from openai_codex.types import (