Skip to content

fix(responses): preserve explicit reasoning none - #75234

Open
andyst-dev wants to merge 2 commits into
NousResearch:mainfrom
andyst-dev:fix/openai-reasoning-none
Open

fix(responses): preserve explicit reasoning none#75234
andyst-dev wants to merge 2 commits into
NousResearch:mainfrom
andyst-dev:fix/openai-reasoning-none

Conversation

@andyst-dev

Copy link
Copy Markdown
Contributor

Fixes #75227.

Summary

  • Preserve an explicit reasoning_effort: none through the OpenAI Responses transport for GPT-5.6 models by sending reasoning.effort: "none" instead of omitting reasoning.
  • Fail fast when none is requested on a Responses route/model where Hermes does not know that value is supported, instead of silently falling back to the model default.
  • Add focused transport coverage for the GPT-5.6 wire payload and the unsupported-model error path.

Validation

  • scripts/run_tests.sh tests/agent/test_codex_responses_adapter.py -q
  • scripts/run_tests.sh tests/tui_gateway/test_reasoning_session_scope.py -q
  • python -m py_compile agent/transports/codex.py tests/agent/test_codex_responses_adapter.py
  • git diff --check

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for isolating a real wire-level regression. Current main drops the explicit disablement: agent/transports/codex.py:219-220 sets reasoning_enabled = False, and the disabled branch at :365-366 emits only include=[].

Problems

  • agent/transports/codex.py:253-260 treats every non-xAI/non-GitHub gpt-5.6* route as known to support reasoning.effort: "none", but _openai_responses_supports_reasoning_none() at :56-63 checks only the model string. The same transport receives arbitrary base_url values from agent/chat_completion_helpers.py:1218-1235; current issuer classification labels those routes other:<base_url> in agent/codex_responses_adapter.py:49-51. This does not satisfy the proposed fail-fast behavior for unknown Responses relays.

Suggested changes

  • Include endpoint/provider capability in the allowlist, rejecting unknown other:<base_url> routes unless support is explicitly known.
  • Add a gpt-5.6 unknown-base-url rejection test in addition to the direct supported-route test.

This is an automated hermes-sweeper review.

Comment thread agent/transports/codex.py Outdated
if explicit_reasoning_none and (
is_xai_responses
or is_github_responses
or not _openai_responses_supports_reasoning_none(model)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guard only excludes xAI and GitHub; the support helper checks the model name but not base_url or provider. ResponsesApiTransport also serves arbitrary other:<base_url> routes, so a GPT-5.6-named custom relay is treated as known-supported rather than failing fast. Please make endpoint capability part of this predicate and cover an unknown-base-url rejection.

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/openai OpenAI / Codex Responses API P2 Medium — degraded but workaround exists labels Jul 31, 2026
@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 31, 2026
@andyst-dev

Copy link
Copy Markdown
Contributor Author

Addressed the review feedback in b4ac12f93.

Changes:

  • Explicit reasoning_effort: none is now allowed only for GPT-5.6 models on known OpenAI Responses routes: the official api.openai.com endpoint or the classified Codex backend.
  • Unknown Responses relays now fail closed even when the model string is gpt-5.6*.
  • Added positive coverage for both official OpenAI and Codex-backend routes, plus the requested unknown-base-URL rejection case.

Validation:

  • scripts/run_tests.sh tests/agent/test_codex_responses_adapter.py -q — 12 passed
  • scripts/run_tests.sh tests/tui_gateway/test_reasoning_session_scope.py -q — 8 passed
  • python -m py_compile agent/transports/codex.py tests/agent/test_codex_responses_adapter.py
  • git diff --check

@andyst-dev
andyst-dev force-pushed the fix/openai-reasoning-none branch from b4ac12f to 86f0fb2 Compare August 6, 2026 06:18
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 sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: reasoning_effort: none silently falls back to the model default on OpenAI Responses

3 participants