feat(codex): present authentic codex CLI version/identity - #50038
feat(codex): present authentic codex CLI version/identity#50038arminanton wants to merge 1 commit into
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for targeting the Codex identity drift. The issue is still present, but this draft needs rework against current main.
Problems
agent/transports/codex.py:133mapsmaxtoxhigh, but current main preservesmaxand maps GPT-5.6 Codexultratomax(agent/transports/codex.py:166-173, commit7550c594ce18d7d100014c2120112576efb03c26).- The current primary request identity remains
codex_cli_rs/0.0.0inagent/auxiliary_client.py:675-696, and the context-window/modelsprobe remains atclient_version=1.0.0inagent/model_metadata.py:1878-1884; neither is changed here. - The resolver selects a cached/latest release rather than the installed executable version (
agent/codex_version.py:139-154), althoughagent/transports/codex_app_server.py:382-413already parsescodex --version. - Defaulting
experimentalApion atagent/transports/codex_app_server.py:176conflicts with the current deliberate avoidance documented inagent/transports/codex_app_server_session.py:255-269.
Suggested changes
- Preserve current
max/ultratransport semantics and cover them with tests. - Centralize authentic version resolution from the configured Codex executable, then wire all current
/modelsand Cloudflare-header paths. - Keep experimental app-server capabilities opt-in unless a tested required behavior justifies them.
Automated hermes-sweeper review.
| # invalid_value, which (e.g. on a Codex fallback from an Anthropic | ||
| # primary configured with effort=max) kills the request. "minimal" | ||
| # is mapped to "low" for older deployments that reject it. | ||
| _effort_clamp = {"minimal": "low", "max": "xhigh"} |
There was a problem hiding this comment.
Current main intentionally preserves max: 7550c594ce18d7d100014c2120112576efb03c26 maps GPT-5.6 Codex tier ultra to Responses wire value max in this same clamp. Do not rewrite max to xhigh; retain the current contract and add a regression test.
| _memo = (now, cached) | ||
| return cached | ||
|
|
||
| fetched = _fetch_github_release() |
There was a problem hiding this comment.
This returns the latest GitHub release, not the version of the configured local Codex executable. Current agent/transports/codex_app_server.py:382-413 already runs codex --version and parses it; use that source if the identity must be authentic.
| # round-trip that some app-server builds gate optional features on. | ||
| # Callers can still override either by passing `capabilities=`. | ||
| default_caps = { | ||
| "experimentalApi": True, |
There was a problem hiding this comment.
Please do not enable this experimental capability by default. Current CodexAppServerSession.ensure_started() explicitly avoids the experimental permissions path because it requires a matching Codex permissions table (agent/transports/codex_app_server_session.py:255-269); no tested consumer here requires this change.
cf14b57 to
d4994c9
Compare
|
Rebased onto current Did not regress the effort mapping (sweeper): dropped the PR's hand-map ( Identity applied consistently (sweeper): the authentic Codex CLI version now flows from a single resolver ( Also removed the |
Resolve the installed codex CLI version (agent/codex_version.py) from the configured executable via `codex --version` (reusing parse_codex_version), with a HERMES_CODEX_CLI_VERSION override and a pinned fallback, memoized per binary. Wire it consistently across all three Codex identity surfaces: the Cloudflare User-Agent in agent/auxiliary_client.py (was codex_cli_rs/ 0.0.0), the /models probe in agent/model_metadata.py (was client_version= 1.0.0), and hermes_cli/codex_models.py, plus the app-server initialize handshake. Reconciled with current main: - Do NOT touch reasoning-effort mapping: main routes through clamp_effort()/codex_supported_efforts() (preserves `max`, clamps `ultra`->`max`); the old draft's max->xhigh hand-map is dropped. - Keep experimental app-server capabilities opt-in (no experimentalApi default) per codex_app_server_session's deliberate avoidance. Tests: new tests/agent/test_codex_version.py (resolver + identity wiring), reasoning-effort regression in test_codex_transport.py.
d4994c9 to
797741e
Compare
Adds
agent/codex_version.py(get_codex_cli_version()— resolves the real Codex CLI version, cached) and uses it across the Codex paths: the models-catalog URL (hermes_cli/codex_models.py), the app-serverinitialize()handshake identity (codex_app_server.py/_session.py), and amax→xhigheffort clamp for the Codex Responses API (transports/codex.py, sincemaxis Anthropic-only and 400s on Codex). Scoped to Codex identity/version; the codex-responses normalization tests are already upstream so that test file was intentionally excluded. Draft for review.