Skip to content

[Bug]: _CODEX_AUX_MODEL = "gpt-5.2-codex" is the only 5.x model rejected by ChatGPT-account Codex backend, breaking all auxiliary fallback #17533

Description

@pokibao

Summary

agent/auxiliary_client.py:269 hardcodes _CODEX_AUX_MODEL = "gpt-5.2-codex" as the Codex fallback for ChatGPT-account users. As of 2026-04-29 this is the only model in the gpt-5.x family that the ChatGPT-account Codex backend rejects, meaning every auxiliary fallback (compression, vision, title generation, etc.) on a ChatGPT-account install silently fails with HTTP 400 "model is not supported".

Reproduction

  • hermes-agent commit: a1921c43 (current main)
  • Account type: ChatGPT subscription Codex auth (`~/.hermes/auth.json`)
  • Verified on two independent installs (MBA + Mac mini), same ChatGPT account

I tested every gpt-5.x model directly against `https://chatgpt.com/backend-api/codex/responses\` with the same OAuth token + `originator: codex_cli_rs` headers Hermes uses:

Model Result
`gpt-5.5` 400 "Instructions are required" → accepted, just missing my body field
`gpt-5.4` 400 "Instructions are required" → accepted
`gpt-5.4-mini` 400 "Instructions are required" → accepted
`gpt-5.3-codex` 400 "Instructions are required" → accepted
`gpt-5.2-codex` 400 "The 'gpt-5.2-codex' model is not supported when using Codex with a ChatGPT account."
`gpt-5` 400 "model is not supported" (rejected, but unused as fallback anyway)

So `_CODEX_AUX_MODEL = "gpt-5.2-codex"` is the worst possible choice — it is the only rejected option among supported alternatives.

Observed user impact

When a ChatGPT-account user's main model (e.g. `gpt-5.5`) hits a transient network error, the auxiliary fallback in `_try_payment_fallback` reaches the Codex branch, instantiates `CodexAuxiliaryClient(real_client, _CODEX_AUX_MODEL)`, and the call fails with the rejection above. Real-world log:

```
2026-04-29 21:18:22 INFO Auxiliary compression: connection error on auto — falling back to openai-codex (gpt-5.2-codex)
2026-04-29 21:18:23 WARNING root: Failed to generate context summary: Error code: 400 - {'detail': "The 'gpt-5.2-codex' model is not supported when using Codex with a ChatGPT account."}. Further summary attempts paused for 60 seconds.
```

The 60s pause repeats each compression cycle, degrading long sessions on Telegram / web UI.

Inline comment in source is also out of date

`auxiliary_client.py:264-268` says:

ChatGPT-backed Codex accounts currently reject gpt-5.3-codex for these auxiliary flows, while gpt-5.2-codex remains broadly available

Per the test table above the situation has reversed: 5.3-codex is accepted today, 5.2-codex is rejected.

Proposed fix

Short-term: change the hardcoded constant to a model that is currently accepted, e.g.

```python
_CODEX_AUX_MODEL = "gpt-5.4" # or "gpt-5.3-codex"
```

Long-term: probe-and-cache the accepted model list once per install via the Codex auth, similar in spirit to #16173 for main models. A static constant for an externally-controlled model list will keep going stale.

Workaround

Local patch `_CODEX_AUX_MODEL = "gpt-5.4"`. Verified working in compression and auxiliary flows.

Why some installs don't hit this

Mac mini install with default `_CODEX_AUX_MODEL = "gpt-5.2-codex"` shows zero "model not supported" errors despite the same Codex backend rejection. Reason: that install runs short cron tasks only — it never triggers compression and never reaches `_try_payment_fallback`. The bug is real on every ChatGPT-account install but only surfaces under long-session usage that triggers auxiliary fallback. Worth flagging in case other users see "works for me" without realizing they just don't trigger the path.

Environment

  • macOS 25.4.0 (Darwin)
  • Python 3.11.15
  • hermes-agent commit `a1921c43`
  • Codex auth: ChatGPT subscription

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundcomp/agentCore agent runtime: loop, agent_init, prompt builder, context-compression, responses endpointprovider/openaiOpenAI / Codex Responses APItype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions