hermes - 💡(How to fix) Fix bug: openai-codex provider — TypeError: 'NoneType' object is not iterable on every request (gpt-5.5)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

After a successful OAuth authentication via hermes model → OpenAI Codex device flow, every API call to the openai-codex provider fails immediately with:

TypeError: 'NoneType' object is not iterable

The error is classified as non-retryable (HTTP None) and the agent falls back to the configured fallback model on every request. The OAuth token is valid and fresh — hermes doctor reports ✓ OpenAI Codex auth (logged in) and last_refresh in auth.json is current.

Error Message

WARNING agent.conversation_loop: API call failed (attempt 1/3) error_type=TypeError
  provider=openai-codex
  base_url=https://chatgpt.com/backend-api/codex
  model=gpt-5.5
  summary='NoneType' object is not iterable
Non-retryable error (HTTP None) — trying fallback...
Primary model failed — switching to fallback

The same error appears in cron job sessions too, so it is not specific to interactive use.

Root Cause

After a successful OAuth authentication via hermes model → OpenAI Codex device flow, every API call to the openai-codex provider fails immediately with:

TypeError: 'NoneType' object is not iterable

The error is classified as non-retryable (HTTP None) and the agent falls back to the configured fallback model on every request. The OAuth token is valid and fresh — hermes doctor reports ✓ OpenAI Codex auth (logged in) and last_refresh in auth.json is current.

Code Example

TypeError: 'NoneType' object is not iterable

---

WARNING agent.conversation_loop: API call failed (attempt 1/3) error_type=TypeError
  provider=openai-codex
  base_url=https://chatgpt.com/backend-api/codex
  model=gpt-5.5
  summary='NoneType' object is not iterable
Non-retryable error (HTTP None) — trying fallback...
Primary model failed — switching to fallback
RAW_BUFFERClick to expand / collapse

Bug Report

Provider: openai-codex Model: gpt-5.5 Endpoint: https://chatgpt.com/backend-api/codex Auth mode: chatgpt (OAuth device flow)

Description

After a successful OAuth authentication via hermes model → OpenAI Codex device flow, every API call to the openai-codex provider fails immediately with:

TypeError: 'NoneType' object is not iterable

The error is classified as non-retryable (HTTP None) and the agent falls back to the configured fallback model on every request. The OAuth token is valid and fresh — hermes doctor reports ✓ OpenAI Codex auth (logged in) and last_refresh in auth.json is current.

Log output

WARNING agent.conversation_loop: API call failed (attempt 1/3) error_type=TypeError
  provider=openai-codex
  base_url=https://chatgpt.com/backend-api/codex
  model=gpt-5.5
  summary='NoneType' object is not iterable
Non-retryable error (HTTP None) — trying fallback...
Primary model failed — switching to fallback

The same error appears in cron job sessions too, so it is not specific to interactive use.

Steps to reproduce

  1. Configure config.yaml with provider: openai-codex, model: gpt-5.5
  2. Authenticate via hermes model → OpenAI Codex → complete device flow in browser
  3. Verify auth: hermes doctor → should show ✓ OpenAI Codex auth (logged in)
  4. Run: hermes chat -q "say hi"
  5. Expected: Response via gpt-5.5 using ChatGPT Plus/Pro subscription
  6. Actual: TypeError: 'NoneType' object is not iterable, immediate fallback

Auth store state

~/.hermes/auth.jsonproviders.openai-codex:

  • auth_mode: chatgpt
  • tokens: contains access_token + refresh_token
  • last_refresh: timestamp of today (re-authed fresh, same result)

Environment

  • OS: macOS 26.3
  • Hermes version: commit d61785889 (latest main as of 2026-05-28)
  • Python: 3.11
  • First observed: 2026-05-27 in cron logs, still reproducible 2026-05-28

Notes

The HTTP None status in the non-retryable error path suggests the response object is None or the streaming response is not structured as expected — possibly the chatgpt.com/backend-api/codex endpoint has changed its response format, or the Bearer token format is no longer accepted. The error surfaces in the codex_responses streaming path in agent/conversation_loop.py.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING