
Codex CLI 0.169.0: Custom Gateways and Headless Device Code Auth
Explore how Codex CLI 0.169.0 simplifies setup by adding custom model provider configuration and device code authorization directly into the terminal UI. We also cover recent quality-of-life updates, including transcript folding and local diagnostic report saving.
Chapter 1
x
James Turner
If you've ever SSH'd into a box, run a login command, and watched it try to open a browser that doesn't exist, this one's for you. Thanks to Jellypod AI for sponsoring this episode. Today on The Codex Changelog: Codex CLI 0.169.0, and the new way to add a custom model provider without ever touching config.toml.
James Turner
Here's what changed. In 0.169.0, you can add or edit custom model providers right from the terminal UI. That's PR 59779. And PR 60009 adds custom gateway selection to the sign-in flow itself. So with custom gateway onboarding enabled, you can create a provider during sign-in. The release notes say that plainly. On top of that, PR 59822 adds device code authorization for gateway OAuth. That's the piece for SSH sessions or machines without a local browser.
James Turner
Why does it matter? Before this, pointing Codex at an OpenAI compatible gateway, think a corporate proxy or an internal router, generally meant hand editing config.toml before you started. And an OAuth login that assumes a browser can stall on a headless server, a container, or a remote cluster. Now the whole onboarding can happen in the terminal, and the approval happens on a different device, like your laptop or phone.
James Turner
How to use it. On a fresh environment, run codex, and at the sign-in chooser, pick the custom gateway option. Remember, that only shows up when custom gateway onboarding is enabled. From there you create the provider in the TUI. You'll enter things like the base URL and how credentials are sourced. If your gateway supports device code, choose that sign-in. The terminal shows a short one time code and a link. Open the link on any machine with a browser, approve it, and the CLI picks up the result and finishes logging in.
James Turner
A few supporting pieces landed too. PR 59787 supports credential export commands for gateway authentication, and PR 59816 retries those exports after an unauthorized response. So if a token goes stale mid session, Codex can try again instead of just failing. PR 59823 binds runtime auth to the provider's selected credential source. And for app server clients, you can now list models, or authorize a gateway, for a configured provider without changing your default provider. That's PRs 59776 and 59819. If you build editor integrations or tooling on the app server, that's a real unlock.
James Turner
Caveats. Device code only works if your gateway actually implements it. If it only takes a static API key or a raw bearer token, you'll configure a credential source instead. Also, device codes are short lived, so approve it quickly. And on managed or enterprise gateways, your admin policy may block device authorization. I'd treat those as things to check, not guarantees, because the release notes don't spell out the failure behavior.
James Turner
Now, a few smaller things in the same release. First, in the full screen transcript there's a Collapse turn details option. It folds completed activity under each prompt, keeps answers visible, and tool output stays searchable. Honestly that's great for long sessions. Second, in the terminal report editor, Ctrl+S saves a diagnostic ZIP locally, even when uploads are disabled. Handy when you want to attach logs to an issue yourself. Third, the option, Yes, clear context and implement, now hands the full approved plan to the fresh session, and if that handoff fails, your current session stays open. That one fixes a nasty little failure mode.
James Turner
And if you caught our earlier episodes on the gated Cloud backend and the untrusted directory hardening in this same release, this is the third piece. Less about what Codex can reach, more about how you get connected in the first place. That's it for today. Go try the device code flow on a box you normally avoid logging into, and see how it feels.