Epic: Bring Codex to parity with Claude Code — cost, sessions, tool pruning, and the unverified surface
Maintainer thường phản hồi trong vòng 1 ngày
@Alan-Cha đang làm issue này rồi.
Từ ngày 14/10/2026.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 6/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- backend, observability
Hướng nghiên cứu
This is a tracking epic, not a single task, and it depends on the unmerged PR #1337. A reasonable entry point is the tool-prune and inference-parser suffix lists, which should share one predicate; check that the /responses path is recognised in both. The other sections need design decisions first, such as whether to bundle non-Anthropic prices, so start by asking a maintainer which section to take.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Follow-on to #942, which lands Codex as a recognised, configurable, parsed agent — the same tier as OpenCode. This issue tracks what it still lacks relative to Claude Code, the reference integration, plus everything #942 shipped unverified.
Depends on #1337 (the PR that completes #942). Nothing here is a regression; it is the gap between "supported" and "at parity".
Where Codex stands today
| Capability | Claude Code | OpenCode | Codex |
|---|---|---|---|
| Recognised agent / per-agent metrics | ✅ | ✅ | ✅ (#1337) |
| Persistent configure + revert | ✅ | ✅ | ✅ (#1337) |
| Typed inference events | ✅ | ✅ | ✅ (#1315, #1326) |
| Token counts | ✅ | ✅ | ✅ |
| Cost | ✅ | model-dependent | ❌ |
| Named sessions | ✅ | ✅ | ❌ |
| Tool pruning | ✅ | ❌ | ❌ |
1. Cost — and this is NOT Codex-specific
Worth stating first because it reframes the work: the bundled price table is Anthropic-only by design. Its generated header says so — "VENDOR LIST prices for the first-party Anthropic endpoint" — and every one of its ~33 entries is a claude-* model. There are zero OpenAI rates.
So Codex's blank cost is not an integration gap. Measured on a live turn: gpt-6-luna reports 1 priceable request and 0 priced ones, with no amount — exactly the "find traffic that is not priced" signal working as designed. OpenCode pointed at a GPT model would report the same.
Two things to decide, and only the second is Codex's:
- Should Cortex bundle non-Anthropic rates at all? A cross-cutting decision affecting OpenCode and any gateway deployment, not just Codex. The generator already reads LiteLLM's full table, so the data is available; the question is whether shipping other vendors' list prices is in scope.
- Document the
pricing:override path indocs/agents/codex.md. Cheap, in scope today, and the right answer regardless of the above. Note the wrinkle: Codex's model is served on a ChatGPT subscription, not per-token billing, so any per-token rate an operator sets is an imputed cost rather than a real one. The doc should say that rather than implying a missing number.
2. Named sessions
Codex's traffic lands in a pending:codex@<pid>.<start> bucket and never leaves it, because it sends none of the three session headers a laptop install reads (X-Claude-Code-Session-Id, X-Task-Id, X-Session-Id). Every other supported agent supplies one: Claude Code, Bob Shell (BobSessionHeader) and OpenCode (SessionIDHeader) each have their own.
Evidence that none arrives: the bucket is never adopted, and adoption only requires any one of the three to carry a value.
- Capture Codex's full request headers and establish whether it sends any stable conversation/thread id. Codex has a session concept of its own (
codex resume,~/.codex/sessions/,session_index.jsonl), so an id may exist on the wire under a name Cortex does not read. If it does, adding it tosession.id_headersmay be the whole fix. - If no header exists, decide between: deriving a session from Codex's own rollout/session files (agentop already harvests Claude Code transcripts, so there is precedent), improving process-tree attribution, or accepting per-process buckets and documenting it.
3. Tool pruning
Unsupported for three independent reasons, any one sufficient — all confirmed by reading the code:
-
agentop tools scandiscovers tools from Claude Code's transcripts (~/.claude/projects/*.jsonl) and proposes only Claude Code's 26 hardcoded built-in names (cmd/agentop/toolscan/known.go). Nothing builds a Codex list. -
tool-prune's default paths are/v1/chat/completions,/v1/completions,/v1/messages./responsesis absent, so it recordsskip/path_not_inferenceon every Codex inference request. - Even with
pathsoverridden, it reads the manifest from a top-leveltoolsarray, while Codex nests its manifest underinput[].tools[].tools[]. It would skip withno_tool_manifest.
Also worth fixing while in here, and arguably first:
-
tool-pruneandinference-parserkeep separate suffix lists, and only the parser's recognises/responses. The drift is silent — the parser parses a request the pruner calls "not inference". One shared predicate would stop the next dialect hitting this.
OpenCode is also unsupported here, so this is the one row where Codex matches OpenCode and only Claude Code is ahead.
4. Unverified surface from #942
Everything #942 shipped was tested on Codex 0.160.1, macOS 26.3 (arm64), against the ChatGPT backend. Untested:
- Linux, and any other Codex version. Every User-Agent string, the
CODEX_dotenv filter and the.envload behaviour are pinned to that one build. -
A live TUI capture.Done — captured in #1337 by allocating a pty directly and typing into the real TUI. Both tokens confirmed, includingcodex-tuion the TUI's own/backend-api/codex/responsesinference requests. The capture also caught an auto-update, so it covers 0.160.1 and 0.162.1, which is the only evidence that the UA shape holds across releases. It corrected one detail: the third UA field is the TERM value, not a literalunknown. - The five unclaimed originator tokens:
codex_vscode,codex_desktop,codex-app-server,codex_mcp_server,codex-cli. All present in the binary; none seen on traffic or traced to aclient_name. Deliberately not folded intocodex(a wrong fold is silent where an unrecognised agent is not) — butcodex_vscodeandcodex_desktopplausibly belong to separate products, the way IBM Bob the IDE does to Bob Shell, and each needs its own decision. - The public
/v1/responsesAPI with an OpenAI API key rather than a ChatGPT subscription. The parser recognises the path, and its non-streaming shape is modelled from the published schema rather than captured traffic. - A
function_call-shaped tool call. Codex's ownexectool is acustom_tool_call; thefunction_callbranch is modelled from the documented schema and has never run on real traffic. - The cost path, unexercised for Codex because no rate applies (see §1).
5. Smaller known issues
-
CODEX_HOMEmust be set whereagentopruns, not only where Codex runs — agentop reads it from its own environment. If Codex is launched with it set (wrapper script, devcontainer, launchd unit) andagentop configure codex enableis run from a plain shell, the two resolve different files andstatusconfirms the wrong one. Documented with--envas the workaround; nothing outside can detect the split. - Chatty non-inference traffic. One
codex execturn produced ~100 recorded events, most of them plugin-list polling and an MCP handshake rather than inference. Consider whether any belong inlistener.skip_hostsguidance for Codex users. -
InferenceToolCall.Argumentsis not JSON for Codex.custom_tool_callarguments are freeform text by design.sparc's reflector tolerates it (JSONDecodeErrorfallback);opahands it to Rego as a plain string, so a policy callingjson.unmarshalon it is the policy author's problem. Documented, but worth a guardrail or a worked Rego example.
Related
- #942 — lands Codex as a supported agent (this issue's prerequisite)
- #1337 — the PR completing #942
- #1363 — Claude Code's second User-Agent is unrecognised; same bug class as #1337's TUI blocker
- #1289 — the
Prior/Writtenrevert gap, shared by all the configure integrations
Assisted-By: Claude (Anthropic AI) [email protected]
- Ngôn ngữ chính
- Go
- Star
- 16
- Fork
- 41
- Merge trung bình
- 11 giờ 25 phút
- Pull request đã merge (30 ngày)
- 269
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rossoctl/cortex
-
UI shows costs for all sessions even when drilled into a sessionCó thể đã có người làm @esnible đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
rossoctl/cortex#1116 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
Maintainer thường phản hồi trong vòng 1 ngày
-
WebSocket inference is unobservable, and the cheap fix would make it worseCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rossoctl/cortex
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
QuantumNous/new-api#7839 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
puppe1990/amarra-cais#355 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Gentleman-Programming/engram#1899 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày