Skip to content

openai-codex multi-turn failures: replayed reasoning item rejected and/or input[*].summary required #258

@trevoraspencer

Description

@trevoraspencer

Summary

Using Hermes with model.provider=openai-codex, first turn succeeds but second turn fails consistently with Responses input errors related to replayed reasoning items.

Environment

  • Hermes: v1.0.0
  • OpenAI SDK: 2.24.0
  • Codex CLI: 0.106.0
  • OS: Ubuntu 24.04.4 LTS
  • Python:
    • Hermes venv: 3.11.14
    • system python: 3.12.3
  • Config:
    • model.default: gpt-5.3-codex
    • model.provider: openai-codex
    • terminal.backend: docker
    • TERMINAL_ENV=docker

Repro

  1. Configure Hermes for openai-codex.
  2. Start a chat.
  3. Send first prompt (hello) -> success.
  4. Send second prompt -> failure.

Observed errors

  1. ValueError: Codex Responses input[1] has unsupported item shape (type='reasoning', role=None).
  2. 400 invalid_request_error: Missing required parameter: 'input[1].summary'.

Request payload detail

In a failing dump, replayed input contains:

{
"type": "reasoning",
"encrypted_content": "..."
}

(no summary field)

Suspected root cause

  • Hermes replays prior reasoning items for Codex continuity.
  • Preflight may reject type=reasoning replay items.
  • Backend appears to require summary on replayed reasoning items.

Local patch/workaround that resolved it

  • Accept replayed reasoning items in preflight.
  • Preserve/include summary when replaying reasoning.
  • Add fallback summary: [] for older persisted sessions with only encrypted_content.
  • Drop malformed reasoning items gracefully instead of hard failing.

Validation

  • Targeted tests pass after patch:
    • python -m pytest -q tests/test_provider_parity.py -k 'reasoning or preflight'
    • 10 passed

Request

Please confirm expected replay schema for Codex reasoning items (summary required?) and align Hermes replay/preflight contract with backend expectations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions