Codex CLI 0.171: codex exec --remote, Workspace On by Default

TL;DR
Codex CLI 0.171.0 adds codex exec --remote to run headless sessions on an existing app server, turns on the TUI workspace by default and picks GPT-6.2 Sol.
Last updated: November 20, 2026
Codex CLI 0.171.0, released November 20, 2026, adds codex exec --remote <ADDR> so a script or CI job can "start or resume noninteractive sessions on an existing app server" instead of booting a fresh Codex process each time. It also makes two defaults change under you: the TUI workspace is now on for everyone, and GPT-6.2 Sol is the default model. If you script codex exec or have muscle memory for the old full-screen layout, this is the release to read before upgrading.
Official Sources#
| Resource | What it confirms |
|---|---|
| Codex CLI 0.171.0 release notes | Every feature and fix in this post, released November 20, 2026 |
| Codex App Server docs | --listen ws://, WebSocket auth flags, and that the WebSocket transport is experimental |
| Non-interactive mode docs | How codex exec and codex exec resume work |
| @openai/codex on npm | 0.171.0 is latest, published 00:51 UTC on November 20 |
codex exec --remote (0.171.0)#
Until now, codex exec always ran its own agent process. The interactive TUI could already attach to a running app server with codex --remote, and 0.171.0 gives the headless command the same option. The new flags in the 0.171.0 help:
--remote <ADDR>
Connect to an existing app server
--remote-auth-token-env <ENV_VAR>
Environment variable containing the remote WebSocket bearer token
codex exec resume --help lists --remote too, so a two-stage pipeline can resume a session on the same server. On 0.170.0 the same command fails with error: unexpected argument '--remote' found.
Here is the loop we ran on 0.171.0, on one machine with no sign-in:
# Terminal 1: an app server on loopback, with token auth
codex app-server --listen ws://127.0.0.1:4500 \
--ws-auth capability-token --ws-token-file /absolute/path/to/token
# Terminal 2: a headless run against it
export CODEX_WS_TOKEN="$(cat /absolute/path/to/token)"
codex exec --remote ws://127.0.0.1:4500 \
--remote-auth-token-env CODEX_WS_TOKEN "review the last commit"
What we saw:
- The app server printed
listening on: ws://127.0.0.1:4500along withreadyzandhealthzURLs, and "binds localhost only (use SSH port-forwarding for remote access)". - With no token configured on either side,
codex exec --remoteconnected, printed a thread id and handed the turn to the server, which then failed on the model call because we were not signed in. So the model request comes from the server, not the exec client. - With token auth on and the wrong token, exec stopped with
failed to connect to remote app server at ws://127.0.0.1:4500/: HTTP error: 401 Unauthorized. With the right token it got past the handshake to the same model-call stage. - Pointing it at a port with no server fails fast with
failed to connect to remote app serverand a connection error, rather than falling back to a local run.
We did not complete a model turn, so output streaming and the final message over --remote are untested here.
%% title: Where the work runs with codex exec --remote in Codex CLI 0.171.0
flowchart LR
A[codex exec --remote ws://host:port] -->|WebSocket, Authorization: Bearer token| B[codex app-server --listen ws://]
B --> C{--ws-auth configured?}
C -->|No, non-loopback| D[Unauthenticated connections allowed during rollout]
C -->|Yes, token matches| E[Session starts or resumes on the server]
C -->|Yes, token wrong| F[401 Unauthorized, exec exits]
E --> G[Model calls, tools and files run on the server machine]Two warnings from the app server docs before you put this in CI:
- "WebSocket transport is experimental and unsupported." In the 0.171.0 binary
codex app-serveritself is still labelled[experimental]. - "Non-loopback WebSocket listeners currently allow unauthenticated connections by default during rollout, so configure WebSocket auth before exposing one remotely." The supported modes are
--ws-auth capability-tokenwith--ws-token-fileor--ws-token-sha256, and--ws-auth signed-bearer-tokenwith--ws-shared-secret-file. The docs say to prefer--ws-token-fileover passing raw tokens on the command line.
Where it helps: a long-lived app server on a build box with warm config, MCP servers and credentials, and short codex exec calls from jobs that should not each hold an API key. The non-interactive docs still recommend API keys as "the right default for automation", so treat a shared server as a deliberate choice, and read our codex exec CI guide for the rest of the headless setup.
The TUI workspace is on by default#
0.171.0 "enabled the TUI workspace by default, with searchable document previews, image previews, and subagent transcripts alongside the main conversation." It is the side-chat workspace that 0.168.0 added behind a flag and that we covered in Codex CLI 0.169. codex features list shows the switch:
| Version | tui_workspace | Default |
|---|---|---|
| 0.170.0 | under development | false |
| 0.171.0 | stable | true |
To get the old layout back, pass --disable tui_workspace or set features.tui_workspace = false in ~/.codex/config.toml. On 0.171.0 both codex --disable tui_workspace features list and codex -c features.tui_workspace=false features list report it as stable false.
GPT-6.2 Sol is the default model#
The release "added GPT-6.2 Sol and Astra to model catalogs, with Sol as the default catalog selection." A fresh CODEX_HOME with no config.toml on 0.171.0 recorded "model":"gpt-6.2-sol" in its session file. If you pinned a model in config.toml or pass -c model=..., nothing changes. If you rely on the default, your next run uses Sol. The models themselves are in our GPT-6.2 Astra and Sol guide.
Also in 0.171.0#
/rcand/remotein the TUI "manage local remote control and display device pairing codes". The CLI equivalent iscodex remote-control start | stop | pair, still marked[experimental].- Custom MCP status lines through
/statusline, only whentui_extensions_statuslineis on. That flag moved from "under development" to "experimental" in 0.171.0 and is still off by default. - Undo and redo shortcuts in the non-Vim composer, "including restoration of attachments and large pastes".
Fixes worth knowing:
- Drafts, queued follow-ups and interrupted input now stay with their original threads when you switch or resume sessions.
- Permission profiles stay intact when you change working directories.
- Late completion events no longer cancel approvals for a newer turn.
- Earlier edits are kept in aggregate diffs when you steer an active turn.
- Enterprise MCP sign-in works with identity providers that issue ID tokens without refresh tokens.
Upgrade checklist#
- Run
codex features list | grep tui_workspaceafter upgrading. If your team wants the old layout, addfeatures.tui_workspace = falseto the shared config. - Check whether any script relies on the default model. Pin
modelinconfig.tomlif you need the old one. - If you try
codex exec --remote, keep the app server on loopback or behind SSH port-forwarding, and turn on--ws-authbefore you bind anything else. - Treat
--remoteas experimental in CI: the WebSocket transport is documented as unsupported.
For the background server that codex agents --no-daemon avoids, see how to turn off the Codex daemon.
FAQ#
What does codex exec --remote do?#
Added in Codex CLI 0.171.0, it starts or resumes a non-interactive codex exec session on an existing app server instead of a fresh local process. The 0.171.0 help text describes it as "Connect to an existing app server", and it takes an address such as ws://127.0.0.1:4500.
How do I authenticate codex exec --remote?#
Start the app server with --ws-auth capability-token --ws-token-file /absolute/path, then pass --remote-auth-token-env with the name of an environment variable that holds the token. In our test a wrong token failed with "HTTP error: 401 Unauthorized" before any session started.
How do I turn off the Codex TUI workspace?#
Codex CLI 0.171.0 marks tui_workspace as stable and on by default. Pass --disable tui_workspace, or set features.tui_workspace = false in ~/.codex/config.toml (the -c features.tui_workspace=false override does the same for one run).
What is the default model in Codex CLI 0.171?#
GPT-6.2 Sol. The release notes say 0.171.0 added GPT-6.2 Sol and Astra to the model catalogs with Sol as the default catalog selection, and a fresh session on 0.171.0 with no config recorded "model":"gpt-6.2-sol".
Sources#
- Codex CLI 0.171.0 release notes - November 20, 2026
- Codex App Server docs - WebSocket transport and auth flags, read November 20, 2026
- Codex non-interactive mode docs -
codex execandcodex exec resume - @openai/codex on npm - versions 0.171.0 and 0.170.0, the binaries tested here
Continue Reading#
- Codex CLI 0.169: codex exec Trust, Side Chats and Model Providers - the previous release post, where the workspace first appeared
- Codex exec in CI - the headless setup
--remoteplugs into - GPT-6.2 Astra and Sol release guide - the new default model
- Codex CLI Background Daemon: How to Turn It Off - the local app-server daemon and
--no-daemon - Codex CLI tool page - what the CLI does, pricing and setup links
Get the next deep dive like this in your inbox
One email a week on Codex and the rest of the AI dev stack. Free.
Read next on AI coding tools
Codex CLI 0.169: codex exec Trust, Side Chats and Model Providers
Codex CLI 0.169.0 keeps project config and MCP servers off in untrusted directories under codex exec, adds --trust, side-chat tabs and a model provider picker.
6 min readCodex Exec in CI: Practical Guide to Headless OpenAI Agents
codex exec is OpenAI's non-interactive mode to run Codex agents from scripts, CI and GitHub Actions. How to set it up safely with real flags and working YAML.
9 min readGPT-6.2 Astra and Sol: Pricing, Benchmarks and What to Switch
GPT-6.2 Astra costs $8/$40 per MTok (20% under GPT-6 Astra), Sol stays $2/$10. Vendor-reported benchmarks, cache rates, Codex setup and who should switch.
8 min readNew here? Start with
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.





