Reverse engineering Codex CLI rollout traces
I spent a weekend building a DeepSeek proxy for Codex CLI so I could generate real tracing data. The proxying was straightforward. What I found when I looked at the actual trace files was not.
The documented format and the real format don't match.
This is the story of that mismatch: what I expected, what I found, and why it matters if you're building runtime tooling for coding agents.
The setup: why a proxy?
Codex CLI uses OpenAI's Responses API (via their SDK). DeepSeek only supports Chat Completions. To use DeepSeek as the backend, I needed a translation proxy — intercept Responses API calls and translate them to Chat Completions.
The proxy ( tools/codex_deepseek_proxy.py ) was straightforward:
Accept POST requests at /responses (or /v1/responses )
Translate the input field (Responses API format) to Chat Completions messages
Translate tool definitions from {"name": "bash", "parameters": {...}} to {"type": "function", "function": {"name": "bash",…