Skip to content

fix(codex): gate unsupported reasoning fields - #29089

Open
offloadteam wants to merge 1 commit into
NousResearch:mainfrom
offloadteam:codex/codex-responses-reasoning-guard-20260520
Open

fix(codex): gate unsupported reasoning fields#29089
offloadteam wants to merge 1 commit into
NousResearch:mainfrom
offloadteam:codex/codex-responses-reasoning-guard-20260520

Conversation

@offloadteam

Copy link
Copy Markdown

Summary

  • avoid sending Responses reasoning fields to unsupported plain GPT-5 mini models
  • keep reasoning effort for newer GPT-5.2+ Responses models
  • preserve encrypted reasoning include for native Codex/o-series models

Tests

  • python -m pytest -o addopts= tests\run_agent\test_run_agent_codex_responses.py::test_codex_transport_omits_reasoning_for_unsupported_gpt5_mini tests\run_agent\test_run_agent_codex_responses.py::test_codex_transport_keeps_reasoning_effort_without_encrypted_include_for_gpt54 tests\run_agent\test_codex_xai_oauth_recovery.py::test_codex_transport_native_codex_still_replays_reasoning_in_input tests\run_agent\test_run_agent_codex_responses.py::test_build_api_kwargs_codex -q

Notes

This is the narrow upstreamable slice from a production Garagebox runtime patch. Diagnostic sentinel and terminal-helper timeout changes were intentionally not included because they need separate design/review.

@houseofmates

Copy link
Copy Markdown

closed via automated cleanup

@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 20, 2026

@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 the narrow fix; the main-agent premise still reproduces on current main.

Problems

  • agent/transports/codex.py:184-186 on origin/main unconditionally sends reasoning={effort, summary} and include=["reasoning.encrypted_content"] for non-GitHub/non-xAI Codex Responses calls, so the reported payload bug is real.
  • The same bug class remains in the auxiliary Codex wrapper. agent/auxiliary_client.py:697-727 says it mirrors agent/transports/codex.py::build_kwargs(), but it still always sets resp_kwargs["reasoning"] and resp_kwargs["include"] = ["reasoning.encrypted_content"] whenever extra_body.reasoning is enabled.

Suggested changes

  • Extract the capability gate into a shared helper and call it from both the main Codex transport and CodexAuxiliaryClient, rather than adding a transport-only allowlist.
  • Add a regression test for the auxiliary path with a GPT-5 mini style model plus extra_body.reasoning, asserting no reasoning and no encrypted reasoning include.

This is an automated hermes-sweeper review.

Comment thread agent/transports/codex.py
kwargs["reasoning"] = {"effort": reasoning_effort, "summary": "auto"}
kwargs["include"] = ["reasoning.encrypted_content"]
model_name = str(model or "").lower().rsplit("/", 1)[-1]
supports_encrypted_reasoning = (

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.

Please make this capability gate shared rather than transport-local. agent/auxiliary_client.py:697-727 mirrors this Codex kwargs logic and still unconditionally emits reasoning plus encrypted include, so fixing only this branch leaves a sibling Codex Responses path with the same bug class.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused payload guard. The main-agent premise remains present on current main.

Problems

  • agent/transports/codex.py:290-299 still unconditionally emits both reasoning and include=["reasoning.encrypted_content"] for non-GitHub/non-xAI Responses calls. However, the same translation remains duplicated in the auxiliary adapter at agent/auxiliary_client.py:918-948, so this transport-only change leaves configured auxiliary calls exposed.
  • The proposed allowlist stops at GPT-5.5. Current coverage requires reasoning effort for gpt-5.6-sol at tests/agent/transports/test_codex_transport.py:78-86; this patch would remove that current behavior for non-Codex GPT-5.6 names.

Suggested changes

  • Put the capability decision in a shared helper used by both the main transport and _CodexCompletionsAdapter.
  • Preserve the GPT-5.6 contract and add an auxiliary regression for an unsupported GPT-5-style model with extra_body.reasoning.

This is an automated hermes-sweeper review.

@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 13, 2026
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.

4 participants