fix(responses): HERMES_DISABLE_REASONING_INCLUDE env-var escape hatch - #25102
Closed
nnnet wants to merge 1 commit into
Closed
fix(responses): HERMES_DISABLE_REASONING_INCLUDE env-var escape hatch#25102nnnet wants to merge 1 commit into
nnnet wants to merge 1 commit into
Conversation
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.
Contributor
Author
|
Closing — will reopen after founder approval of each fix individually (per request). Code unchanged, branch preserved on fork. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Responses API rejects
include: [\"reasoning.encrypted_content\"]on non-reasoning models with:Users running Hermes against
api.openai.comwith 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
~/.hermes/.env:OPENAI_API_KEY=sk-...~/.hermes/config.yaml:gpt-5-nanoetc.).Root cause
agent/transports/codex.py:109,124andagent/auxiliary_client.py:690unconditionally setinclude=[\"reasoning.encrypted_content\"]wheneverreasoning_enabledis 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 theincludeparameter and thereasoningblock in the outgoing Responses-API kwargs. Default behavior (always sendinclude) is preserved when the env var is unset or falsy.Why an env var and not model-family detection?
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.agent.model_metadata.is_reasoning_model()to make this automatic; this PR unblocks users today.Testing
docker compose build gateway).docker compose up -d gateway— container healthy./v1/models,/v1/responses) responds normally after restart with the founder'sgpt-5-nanodefault config (env var unset)._reasoning_include_disabled()returnsFalseby default,TrueforHERMES_DISABLE_REASONING_INCLUDEin{1, true, yes, on}.build_kwargs(\"gpt-4o-mini\", ...)includes[\"reasoning.encrypted_content\"]andreasoning={\"effort\":\"medium\",\"summary\":\"auto\"}(default behavior preserved).\"true\": same call returns kwargs with noincludeand noreasoningblock.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) -> booland 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.