Skip to content

fix(agent): only upgrade to codex_responses for models that require it#23734

Open
AllynSheep wants to merge 2 commits into
NousResearch:mainfrom
AllynSheep:fix/no-include-for-non-responses-models
Open

fix(agent): only upgrade to codex_responses for models that require it#23734
AllynSheep wants to merge 2 commits into
NousResearch:mainfrom
AllynSheep:fix/no-include-for-non-responses-models

Conversation

@AllynSheep

Copy link
Copy Markdown
Contributor

Summary

Previously, any direct OpenAI URL (api.openai.com) would trigger an upgrade from chat_completions to codex_responses transport. This caused GPT-4o (which uses Chat Completions API) to receive the include: ["reasoning.encrypted_content"] parameter, which is only supported by o1/o3 series via Responses API.

Root Cause

In run_agent.py lines 1267-1282, the condition included _is_direct_openai_url() which returned True for ALL api.openai.com URLs, even for models that don't support the include parameter.

Fix

Removed _is_direct_openai_url() from the upgrade condition. Now the upgrade to codex_responses only happens when _provider_model_requires_responses_api() returns True (i.e, for GPT-5.x models).

Testing

  • GPT-4o with api.openai.com/v1 now uses chat_completions transport (correct)
  • GPT-5.x models still correctly use codex_responses transport
  • include parameter is only sent for models that support Responses API

Fixes

Closes #23450

Previously, any direct OpenAI URL (api.openai.com) would trigger
an upgrade from chat_completions to codex_responses transport.
This caused GPT-4o (which uses Chat Completions API) to receive
the `include: ["reasoning.encrypted_content"]` parameter,
which is only supported by o1/o3 series via Responses API.

Fix: only upgrade to codex_responses when the model actually
requires the Responses API (gpt-5.x), not for all api.openai.com
models.

Fixes NousResearch#23450
@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent loop, run_agent.py, prompt builder provider/openai OpenAI / Codex Responses API P2 Medium — degraded but workaround exists labels May 11, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #23460 — both fix the same root cause (codex transport sends include: ["reasoning.encrypted_content"] to Chat Completions API models that don't support it). Both close #23450.

This PR removes _is_direct_openai_url() from the upgrade condition; #23460 may take a different approach. Maintainer should pick one.

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

Labels

comp/agent Core agent loop, run_agent.py, prompt builder 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.

[Bug]: [Bug]: Hermes v0.13.0 sends unsupported include parameter causing "Encrypted content is not supported with this model" error with OpenAI GPT-4o

2 participants