You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Added Codex.AppServer.connect_remote/2 to support managed remote
websocket connections. This includes transport policy checks for safe
websocket usage, auth-token transport validation, and support for
auth_token/auth_token_env.
- Realtime: Session now defers follow-up response.create requests until the
current response finishes (response.done), preventing overlapping turns
from causing premature creation.
- Realtime: Diagnostics probe uses a schema-compatible turn and treats
unknown_parameter-style schema drift as a protocol-incompatible skip
reason rather than a hard failure.
- OAuth: Canonicalize ChatGPT plan strings (e.g., "hc" -> "enterprise",
"education" -> "edu") before SDK processing.
- CLI: Interactive, resume, and fork helpers now support --remote and
--remote-auth-token-env. Added support for websocket auth flags in
Codex.CLI.app_server/1.
- AppServer: Added experimentalFeature/enablement/set support.
Copy file name to clipboardExpand all lines: README.md
+62-2Lines changed: 62 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,8 +25,8 @@ An idiomatic Elixir SDK for embedding OpenAI's Codex agent in your workflows and
25
25
## Features
26
26
27
27
-**End-to-End Codex Lifecycle**: Spawn, resume, and manage full Codex threads with rich turn instrumentation.
28
-
-**Multi-Transport Support**: Default `:exec` compatibility selector for the core-backed exec JSONL lane (`codex exec --json`) plus stateful app-server JSON-RPC over stdio (`codex app-server`) with multi-modal `UserInput` blocks.
29
-
-**CLI Passthrough and PTY Sessions**: `Codex.CLI` can launch root `codex`, `cloud`, `completion`, `features`, `mcp`, `sandbox`, `resume`, `fork`, `app-server`, and other command-surface workflows directly.
28
+
-**Multi-Transport Support**: Default `:exec` compatibility selector for the core-backed exec JSONL lane (`codex exec --json`) plus stateful app-server JSON-RPC via managed local stdio children or managed remote websockets.
29
+
-**CLI Passthrough and PTY Sessions**: `Codex.CLI` can launch root `codex`, `cloud`, `completion`, `features`, `mcp`, `sandbox`, `resume`, `fork`, `app-server`, and other command-surface workflows directly, including remote-root and websocket-auth app-server flags.
30
30
-**Native OAuth**: `Codex.OAuth` provides SDK-managed browser/device login, refresh, status, and logout with upstream-compatible `auth.json` persistence or memory-only sessions.
31
31
-**Upstream Compatibility**: Mirrors Codex CLI flags (profile/OSS/full-auto/color/search/config overrides/review/resume) and handles app-server protocol drift (e.g. MCP list method rename fallbacks).
The SDK forwards the `enablement` map as given and lets the server validate the
365
+
current supported keys.
366
+
324
367
### Raw CLI Passthrough and Interactive Sessions
325
368
326
369
Use `Codex.CLI.run/2` when you want literal command-surface parity with the upstream terminal client, and `Codex.CLI.interactive/2` or `Codex.CLI.start/2` when you need a long-running or PTY-backed session.
This layer is also the simplest way to reach CLI-only workflows such as `codex completion`, `codex cloud`, `codex execpolicy`, `codex features`, `codex mcp-server`, and the root interactive client without dropping down to `System.cmd/3` yourself.
382
425
426
+
Current upstream parity helpers also include:
427
+
428
+
-`Codex.CLI.interactive/2`, `resume/2`, and `fork/2` accept `remote:` and `remote_auth_token_env:`
-**App-server JSON-RPC (optional)**: `codex app-server`(newline-delimited JSON messages over stdio)
8
+
-**App-server JSON-RPC (optional)**: managed local `codex app-server`over stdio or managed remote app-server over websocket
9
9
10
10
Use app-server when you need upstream v2 APIs that are not exposed via exec JSONL (threads list/archive, skills/models/config APIs, server-driven approvals, etc.).
11
11
@@ -30,6 +30,10 @@ If you need the literal command surface instead of the managed JSON-RPC connecti
30
30
`Codex.CLI.app_server/1` launches a raw `codex app-server` subprocess session and
31
31
`Codex.CLI.run/2` can be used for one-shot passthrough commands.
32
32
33
+
`Codex.CLI.app_server/1` also forwards the current websocket auth flags:
@@ -208,6 +255,10 @@ Current upstream routing and sync controls are also covered:
208
255
`!` workflow, so treat it with the same care you would give shell access in the
209
256
interactive CLI.
210
257
258
+
`experimental_feature_enablement_set/2` forwards the `enablement` map as given.
259
+
The SDK does not keep a stale local allowlist; the connected app-server remains
260
+
the source of truth for supported feature keys.
261
+
211
262
When `include_layers: true`, `config_read/2` returns a `layers` list. Recent Codex versions encode each layer's `name` as a tagged union (`ConfigLayerSource`), for example:
Copy file name to clipboardExpand all lines: guides/06-realtime-and-voice.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,11 @@ helps CLI/app-server flows; realtime and voice still need an API key or an
21
21
22
22
If your account has no credits, direct API calls may return `insufficient_quota` (HTTP 429). If your account lacks access to realtime models, calls may fail with `model_not_found`. When the upstream Realtime service itself returns a generic `server_error`, the realtime examples now run a minimal raw-WebSocket probe first and print `SKIPPED` with the detected `session_id` so you can report the exact upstream failure cleanly.
23
23
24
+
`Codex.Realtime.Diagnostics.probe_text_turn/1` keeps that probe minimal and now
25
+
classifies `unknown_parameter`-style schema mismatches as a
26
+
`realtime_protocol_incompatible` skip reason instead of a hard failure. This
27
+
helps distinguish upstream schema drift from auth/quota/runtime failures.
28
+
24
29
Custom trust roots use `CODEX_CA_CERTIFICATE` first and `SSL_CERT_FILE` second. Blank values are
25
30
ignored. The same PEM bundle is applied to HTTPS requests and secure realtime websockets.
26
31
@@ -80,6 +85,11 @@ chunks
80
85
end)
81
86
```
82
87
88
+
If you queue additional text input or tool output while a response is still
89
+
active, `Codex.Realtime.Session` defers the follow-up `response.create` until
90
+
the current response reaches `response.done`. That keeps overlapping turns from
91
+
issuing premature create requests.
92
+
83
93
### Receiving events
84
94
85
95
Realtime events are delivered as `{:session_event, event}`:
0 commit comments