The Codex Changelog
All Episodes
Codex 0.170.0: Auto-Refreshing Headers for OpenTelemetry Exporters

Codex 0.170.0: Auto-Refreshing Headers for OpenTelemetry Exporters

0:00|0:00

Codex CLI 0.170.0 introduces automatically refreshed authentication headers for OpenTelemetry HTTP exporters to support rotating credentials. We also cover opt-in agent logging flags, best-effort delivery limitations, and quality-of-life updates including TUI WebRTC calls and sandbox security fixes.


Chapter 1

Refreshable OTLP Headers in 0.170.0

James Turner

If you've ever had a telemetry pipeline go quiet at three in the morning because a token expired, this release is for you. Thanks to Jellypod AI for sponsoring this episode. Codex CLI 0.170.0 shipped on November 18th, and the change I want to focus on is automatically refreshed authentication headers for OpenTelemetry HTTP exporters.

James Turner

Quick tie back to an earlier episode. We covered the OpenTelemetry headers helper in Codex 0.167.2. This release is the follow through. Pull request 61018 extracts the HTTP headers helper execution into a shared crate, and pull request 61028, from abhinav-oai, uses it to add refreshable headers for OTLP HTTP exporters. So the helper isn't just a one off anymore. It's shared plumbing.

James Turner

What changed, exactly. The codex-otel crate's settings struct, OtelSettings, has a headers_helper field. When it's set, Codex runs that helper to get fresh authentication headers for the OTLP HTTP exporter instead of relying on a static header you wrote into config once. The release notes put it plainly: automatically refreshed authentication headers for OpenTelemetry HTTP exporters.

James Turner

Why does that matter? Think about what collectors often want. Rotating bearer tokens, short lived credentials, OAuth tokens. If your header is baked in at startup, it works until the token expires, and then exports start failing. That's my interpretation of the failure mode, not something the release notes spell out, but it's the obvious consequence for a long running session, a background process, or a CI runner that outlives its credential.

James Turner

Now, how do you use it. The exporter config itself looks like what you already know. In your config file, under otel, you set the exporter to otlp http, with an endpoint and a protocol, binary or json. The README example for logs looks like this: exporter equals otlp http, endpoint equals your collector's slash v1 slash logs URL, protocol equals json. What's new is that headers_helper sits beside that, so the credentials come from the helper rather than a hard coded map.

James Turner

One honest gap. The sources I have show the headers_helper field in the Rust settings, set to None in the README example, but I don't have the exact config file key or helper contract spelled out. So before you wire this into production, check the codex-otel README and the pull request 61028 for how the helper is invoked. I'd rather say that than invent syntax.

James Turner

Caveats. First, the README is clear that delivery uses the existing best effort OTLP exporter, with no exactly once guarantee. So don't treat this as an audit trail. Second, there are two opt in log settings worth knowing about. otel dot log_agent_responses emits final answers from main agents and spawned task agents. otel dot log_guardian_assessments emits Guardian review results. Both default to false. Each export is capped at 65,536 UTF 8 bytes, and the README warns the content is potentially sensitive, including subagent work that never appears in the main answer.

James Turner

So here's the practical point. Refreshing credentials makes it easier to keep a pipe open for a long time. That's good, and it also means you should decide deliberately what flows through it before you enable those two flags.

Chapter 2

Smaller Fixes Worth Knowing

James Turner

A handful of smaller things in 0.170.0 worth a mention. The TUI gets WebRTC negotiation for realtime voice calls, pull request 61172. There's experimental support for identically named MCP servers across environments, so same names no longer collide. Oversized WebSocket requests now fall back to HTTP right away, without pointless retries.

James Turner

On the reliability side, MCP OAuth got fixes for credential races during cancellation, login, and logout. Windows got fixes for atomic file writes, sandbox permission preservation, and runtime registration recovery. And one I like for security: permission updates and child threads no longer lose existing sandbox restrictions. That's the kind of fix you want quietly landing.

James Turner

To try it, run npm install dash g at openai slash codex at 0.170.0. If you export telemetry, read that otel README first. And maybe check your token lifetimes while you're at it. Thanks again to Jellypod AI for sponsoring this episode.