Skip to content

fix(transports/codex): clamp 'xhigh' reasoning effort to 'high' for xAI Grok - #42330

Closed
hex0x42424242 wants to merge 1 commit into
NousResearch:mainfrom
hex0x42424242:fix/grok-xhigh-reasoning-effort
Closed

fix(transports/codex): clamp 'xhigh' reasoning effort to 'high' for xAI Grok#42330
hex0x42424242 wants to merge 1 commit into
NousResearch:mainfrom
hex0x42424242:fix/grok-xhigh-reasoning-effort

Conversation

@hex0x42424242

Copy link
Copy Markdown

The xAI Responses API for Grok supports 'low', 'medium', and 'high' reasoning effort levels, but lacks native support for 'xhigh'. When 'xhigh' effort is passed to Grok models that accept reasoning.effort, it fails or reverts to default settings. This PR updates the Codex responses transport to clamp 'xhigh' to 'high' specifically when is_xai_responses is True, preventing errors when calling Grok models with 'xhigh' effort. It also adds unit tests to verify the behavior under both xAI and generic Codex responses paths.

…AI Grok

The xAI Responses API for Grok supports 'low', 'medium', and 'high' reasoning effort levels, but lacks native support for 'xhigh'. When 'xhigh' effort is passed, it fails or reverts to default settings. This commit updates the Codex responses transport to clamp 'xhigh' to 'high' specifically when is_xai_responses is True.
@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/xai xAI (Grok) P3 Low — cosmetic, nice to have labels Jun 8, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused xAI compatibility fix. This is already implemented on current main by a stronger follow-up.

Automated hermes-sweeper review evidence:

  • agent/transports/codex.py:170-173 now maps xAI Responses xhigh, max, and ultra to high.
  • tests/agent/transports/test_codex_transport.py:414-423 covers all three values, including the PR's xhigh case.
  • The implementation landed in 7550c594ce18d7d100014c2120112576efb03c26 (feat(reasoning): add max and ultra effort levels (#62650)), which is present on current main.

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 P3 Low — cosmetic, nice to have provider/xai xAI (Grok) sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants