Skip to content

fix(responses): HERMES_DISABLE_REASONING_INCLUDE env-var escape hatch - #25102

Closed
nnnet wants to merge 1 commit into
NousResearch:mainfrom
nnnet:fix/bug-2-encrypted-content-env-escape
Closed

fix(responses): HERMES_DISABLE_REASONING_INCLUDE env-var escape hatch#25102
nnnet wants to merge 1 commit into
NousResearch:mainfrom
nnnet:fix/bug-2-encrypted-content-env-escape

Conversation

@nnnet

@nnnet nnnet commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

The Responses API rejects include: [\"reasoning.encrypted_content\"] on non-reasoning models with:

HTTP 400: Encrypted content is not supported with this model.
param='include', code='model_not_found'

Users running Hermes against api.openai.com with a non-reasoning model (e.g. gpt-4o-mini) have no way to opt out — every request fails. This PR adds an env-var escape hatch.

Repro

  1. ~/.hermes/.env: OPENAI_API_KEY=sk-...
  2. ~/.hermes/config.yaml:
    model:
      default: gpt-4o-mini
      provider: auto
      base_url: https://api.openai.com/v1
  3. Send any message via Telegram / API.
  4. Observed: HTTP 400 on every call.
  5. Workaround until this PR: switch to a reasoning model (gpt-5-nano etc.).

Root cause

agent/transports/codex.py:109,124 and agent/auxiliary_client.py:690 unconditionally set include=[\"reasoning.encrypted_content\"] whenever reasoning_enabled is true (the default). The parameter is only accepted by reasoning-capable models (o-series, gpt-5*); the Responses API returns 400 on every other model.

Fix

Add a single env var, HERMES_DISABLE_REASONING_INCLUDE, that suppresses both the include parameter and the reasoning block in the outgoing Responses-API kwargs. Default behavior (always send include) is preserved when the env var is unset or falsy.

Why an env var and not model-family detection?

  1. ~30 tests assert include == [\"reasoning.encrypted_content\"] on every Responses-API path; teaching the transport about reasoning-capable model families would require revising every one of those test expectations. That's a larger refactor and a riskier PR.
  2. The env var is opt-in and 100% backward compatible — nothing changes for existing users.
  3. A follow-up PR can introduce agent.model_metadata.is_reasoning_model() to make this automatic; this PR unblocks users today.

Testing

  • Docker image rebuilds (docker compose build gateway).
  • docker compose up -d gateway — container healthy.
  • API server (/v1/models, /v1/responses) responds normally after restart with the founder's gpt-5-nano default config (env var unset).
  • In-container integration check:
    • _reasoning_include_disabled() returns False by default, True for HERMES_DISABLE_REASONING_INCLUDE in {1, true, yes, on}.
    • With env var unset: build_kwargs(\"gpt-4o-mini\", ...) includes [\"reasoning.encrypted_content\"] and reasoning={\"effort\":\"medium\",\"summary\":\"auto\"} (default behavior preserved).
    • With env var \"true\": same call returns kwargs with no include and no reasoning block.

Breaking changes

None. Default behavior is unchanged. The env var is opt-in.

Follow-up

A follow-up PR can introduce agent.model_metadata.is_reasoning_model(model_id) -> bool and switch the transport to use it automatically — at which point the env var can be deprecated in favour of automatic detection.


PR by Claude Code on behalf of @nnnet. Tracks internal bug tracker entry BUG-2.

The Responses API rejects ``include: ["reasoning.encrypted_content"]``
on non-reasoning models with:

    HTTP 400: Encrypted content is not supported with this model.
    param='include', code='model_not_found'

Users targeting a non-reasoning OpenAI model (e.g. ``gpt-4o-mini`` via
``base_url: https://api.openai.com/v1``) currently have no way to opt
out other than switching to a reasoning model.

Add ``HERMES_DISABLE_REASONING_INCLUDE=true`` (~/.hermes/.env) that
suppresses both the ``include`` parameter and the ``reasoning`` block
from the outgoing Responses-API kwargs.  Default behavior — sending
``include=["reasoning.encrypted_content"]`` on every Responses-API call
— is preserved when the env var is unset or falsy.

Touches two call sites:

- ``agent/transports/codex.py`` — main agent's Responses API transport.
- ``agent/auxiliary_client.py:690`` — Codex auxiliary client path.

A long-term fix is automatic detection of the reasoning family in
``agent/model_metadata.py``, but the existing tests pin the current
unconditional behavior, so the env-var escape hatch is the smallest
change that addresses the user-visible breakage without revising
~30 pinned test expectations.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/openai OpenAI / Codex Responses API labels May 13, 2026
@nnnet

nnnet commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

Closing — will reopen after founder approval of each fix individually (per request). Code unchanged, branch preserved on fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists provider/openai OpenAI / Codex Responses API type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants