feat(transports/codex): pass reasoning.effort to xAI Responses API

The is_xai_responses branch only sent include=[reasoning.encrypted_content]
without forwarding the resolved reasoning_effort. Other Responses providers
(OpenAI, GitHub) already get effort forwarded — this aligns the xAI path.

Without this, agent.reasoning_effort is silently dropped on the xAI direct
path, making Hermes unable to control reasoning depth on grok-4.x via
api.x.ai. Tests added to TestCodexBuildKwargs cover effort passthrough,
disabled state, and minimal-clamp parity with non-xAI.
This commit is contained in:
Julien Talbot 2026-05-08 23:45:47 +04:00 committed by Teknium
parent 252d68fd45
commit cd712b176a
2 changed files with 32 additions and 0 deletions

View file

@ -105,6 +105,7 @@ class ResponsesApiTransport(ProviderTransport):
if reasoning_enabled and is_xai_responses:
kwargs["include"] = ["reasoning.encrypted_content"]
kwargs["reasoning"] = {"effort": reasoning_effort}
elif reasoning_enabled:
if is_github_responses:
github_reasoning = params.get("github_reasoning_extra")