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
{{ message }}
Repository navigation
feature: Codex support — detection, settings, parsed events, token and cost accounting #942
Patch it to use localhost:47600 and the Cortex CA; ask before editing, support revert
Traffic parsed into typed events, not merely proxied
Token counts and cost correct for its wire format
Metrics aggregate alongside other agents
A tool inventory, or state explicitly that tool pruning is unsupported
Required artifact: a doc for Codex
This issue does not close on code alone. The doc is a deliverable like the code: it ships
in the same PR, or in a linked PR merged before this issue closes. A PR description or a
comment here does not count.
It is docs/agents/codex.md in this repo, linked from the root README's Any agent works line
and from the index in docs/agents/README.md (#939). It covers:
Enable and revert — the agentop configure commands for Codex, which file each one
writes, and how to undo it by hand
CA trust — what Codex needs to trust the Cortex CA, and the symptom when it does not
What Cortex shows for it — which events are typed, which token and cost fields are
filled, and what is partial or unsupported (e.g. tool pruning)
Verified depth — the Codex versions and platforms actually tested, and what was not
Known issues specific to Codex
cmd/agentop/README.md can carry the command reference too; it does not replace this page.
Additional Context
Part of the Cortex v0.9.0 release, stretch scope — deferred past v0.9.0 as the agent least
used internally, so it proves the least about the release. Depends on the agent integration contract.
Codex can be started under Cortex with abctl exec -- codex. Note that it reports
⚠ Falling back from WebSockets to HTTPS transport. unexpected status 405 Method Not Allowed: {"detail":"Method Not Allowed"}, url:
wss://chatgpt.com/backend-api/codex/responses, cf-ray: ..., request id: ...
Cortex doesn't yet see Codex inference traffic; it sees
346 11:06:32.41 out req observe initialize chatgpt.com
346 11:06:32.60 out resp observe initialize 200 185ms chatgpt.com
353 11:06:32.60 out req observe notifications/ini… chatgpt.com
353 11:06:32.75 out resp observe notifications/ini… 204 152ms chatgpt.com
364 11:06:32.75 out req observe tools/list chatgpt.com
364 11:06:33.00 out resp observe tools/list 200 251ms chatgpt.com
Split out #1239 for the OpenAI Responses API parser support that this issue's "typed events" / "token counts and cost" checklist items depend on — it's not Codex-specific (any future integration against OpenAI's newer API hits the same gap), so it's tracked on its own rather than as a sub-bullet here.
#1289 is relevant to this issue's "patch it... support revert" checklist item: the Claude Code implementation this would follow has a live bug where disable ignores any value change made since enable and silently overwrites it. Worth designing Codex's dotenv-based enable/disable with the fix (storing both Prior and Written, logging on mismatch) rather than copying the current behavior as-is.
#1315 (closes #1239) delivers the "typed events" and "token counts and cost" checklist items for Codex via real-traffic-verified Responses API support in inference-parser. Remaining open items here: settings-patching/persistent config, tool inventory, metrics aggregation, and docs.
#1326 recovers a commit that was pushed to #1315 but dropped at merge time (stale merge head, not a code issue) — tool-call capture for Codex's Responses API traffic.
#1337 delivers the "patch it... support revert" checklist item for Codex: agentop configure codex enable/disable/status, writing/reverting ~/.codex/.env (confirmed to be auto-loaded by the real Codex CLI). Deliberately scoped to the simple, one-shot Prior restore claude-code's disable already uses — not the stricter Written-based drift check tracked by #1289, which stays a separate pass across all three integrations.
Remaining open items here: tool inventory, metrics aggregation verification, and the rest of docs/agents/codex.md.
#1337 now covers the remaining three checklist items as well, so it closes this issue:
Patch it / support revert — agentop configure codex enable/disable/status, writing ~/.codex/.env.
Metrics aggregate alongside other agents — codex_exec and codex-mcp-client fold to a canonical codex agent name. Verified live: series:codex appears in GET /v1/usage?group=agent with its token counts, and Codex's traffic moved out of the spawning agent's session into its own pending:codex@<pid> bucket. Its telemetry exporter (OTel-OTLP-Exporter-Rust) is deliberately not claimed.
Tool inventory — taking the "state explicitly that tool pruning is unsupported" option, with three independent reasons documented.
The doc — docs/agents/codex.md has all five required sections and is linked from the README's supported-agents table.
Two findings documented rather than fixed, both worth knowing before this closes:
Tokens aggregate, cost does not. No rate ships for Codex's model, which is subscription-served rather than per-token billed, so a turn counts as priceable-but-unpriced. If per-token rates for it are not public, "correct cost" may not be achievable for Codex rather than merely unimplemented — worth a second opinion on whether that satisfies the "cost correct for its wire format" item or needs its own issue.
Codex never leaves its pending bucket. It sends none of the three session headers a laptop install reads, so its traffic groups per-process rather than per-session. Named in Known issues; a future Codex session header would just need adding to session.id_headers.
Also surfaced while doing this, unrelated to Codex and not fixed here: tool-prune and inference-parser keep separate endpoint suffix lists, and only the parser's recognises /responses. The drift is silent — the parser reads a request the pruner skips as path_not_inference. Probably worth its own issue.
Activity
esnible commentedon Sep 15, 2026
The Codex CLI can be obtained from https://learn.chatgpt.com/docs/codex/cli
Codex can be started under Cortex with
abctl exec -- codex. Note that it reportsCortex doesn't yet see Codex inference traffic; it sees
Those events are related to MCP, not inferencing.
esnible commentedon Sep 20, 2026
Codex can be permanently configured to use Cortex's proxy by adding env vars to ~/.codex/.env.
Alan-Cha commentedon Oct 2, 2026
Split out #1239 for the OpenAI Responses API parser support that this issue's "typed events" / "token counts and cost" checklist items depend on — it's not Codex-specific (any future integration against OpenAI's newer API hits the same gap), so it's tracked on its own rather than as a sub-bullet here.
Alan-Cha commentedon Oct 5, 2026
#1289 is relevant to this issue's "patch it... support revert" checklist item: the Claude Code implementation this would follow has a live bug where
disableignores any value change made sinceenableand silently overwrites it. Worth designing Codex's dotenv-based enable/disable with the fix (storing bothPriorandWritten, logging on mismatch) rather than copying the current behavior as-is.Alan-Cha commentedon Oct 7, 2026
#1315 (closes #1239) delivers the "typed events" and "token counts and cost" checklist items for Codex via real-traffic-verified Responses API support in
inference-parser. Remaining open items here: settings-patching/persistent config, tool inventory, metrics aggregation, and docs.Alan-Cha commentedon Oct 7, 2026
#1326 recovers a commit that was pushed to #1315 but dropped at merge time (stale merge head, not a code issue) — tool-call capture for Codex's Responses API traffic.
Alan-Cha commentedon Oct 8, 2026
#1337 delivers the "patch it... support revert" checklist item for Codex:
agentop configure codex enable/disable/status, writing/reverting~/.codex/.env(confirmed to be auto-loaded by the real Codex CLI). Deliberately scoped to the simple, one-shotPriorrestore claude-code'sdisablealready uses — not the stricterWritten-based drift check tracked by #1289, which stays a separate pass across all three integrations.Remaining open items here: tool inventory, metrics aggregation verification, and the rest of
docs/agents/codex.md.feat: Recognise Codex as an agent, and document what Cortex shows for it
Alan-Cha commentedon Oct 9, 2026
#1337 now covers the remaining three checklist items as well, so it closes this issue:
agentop configure codex enable/disable/status, writing~/.codex/.env.codex_execandcodex-mcp-clientfold to a canonicalcodexagent name. Verified live:series:codexappears inGET /v1/usage?group=agentwith its token counts, and Codex's traffic moved out of the spawning agent's session into its ownpending:codex@<pid>bucket. Its telemetry exporter (OTel-OTLP-Exporter-Rust) is deliberately not claimed.docs/agents/codex.mdhas all five required sections and is linked from the README's supported-agents table.Two findings documented rather than fixed, both worth knowing before this closes:
session.id_headers.Also surfaced while doing this, unrelated to Codex and not fixed here:
tool-pruneandinference-parserkeep separate endpoint suffix lists, and only the parser's recognises/responses. The drift is silent — the parser reads a request the pruner skips aspath_not_inference. Probably worth its own issue.docs: Name Codex in the README's supported-agents line
feat: Add agentop configure codex enable/disable/status