Skip to content

gpt-5.4 shows 32k context in Hermes instead of 1,050,000 #5173

@zaycruz

Description

@zaycruz

Bug

Hermes can show gpt-5.4 with a 32k context window in Codex-backed setups.

Repro

  • Use Hermes with gpt-5.4 on the Codex endpoint
  • Hermes shows 32k context

Expected

gpt-5.4 should resolve to 1,050,000 context tokens.

Actual

Hermes can persist a bad cache entry like:
gpt-5.4@https://chatgpt.com/backend-api/codex: 32000

Likely cause

A small output-token-related value is being persisted or reused as the model context window.

Reference

OpenAI currently lists gpt-5.4 at 1,050,000 context and 128,000 max output tokens:
https://developers.openai.com/api/docs/models/gpt-5.4

Fix

I have a patch prepared that:

  • maps openai-codex to provider-aware OpenAI metadata
  • ignores suspicious small cached context values for large-context OpenAI models
  • adds regression tests for the stale Codex cache case

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/agentCore agent loop, run_agent.py, prompt builderprovider/openaiOpenAI / Codex Responses APIsweeper:implemented-on-mainSweeper: behavior already present on current maintype/bugSomething isn't working

    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