From b38165acd06cdb617f8047db58f60c1d6ac6027b Mon Sep 17 00:00:00 2001 From: Vishnu Mohta Date: Fri, 22 May 2026 22:58:00 +0530 Subject: [PATCH] fix(codex transport): default reasoning_enabled=False for non-reasoning models MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Codex Responses transport defaulted reasoning_enabled=True, which adds include[reasoning.encrypted_content] to every request through that path. Non-reasoning models reject that field with HTTP 400: Error code: 400 - {'error': {'message': 'Encrypted content is not supported with this model.', 'type': 'invalid_request_error', 'param': 'include', 'code': None}} This bites the fallback chain on personal-laptop deployments: when the primary local model (MLX, Ollama) goes down and Hermes falls back to a non-reasoning OpenAI model (gpt-4o-mini, gpt-4.1-mini), the whole tool list is rejected before the request even reaches the model. Flipping the default to False fixes this transparently: - Non-reasoning models: include[encrypted_content] no longer sent ✓ - Reasoning models (o1, o3, grok-thinking, codex backend, xAI): still opt in via reasoning_config={"enabled": True} or {"effort": "..."} - All existing opt-in code paths (lines 87-90) preserved unchanged Repro: hermes chat -q 'hello' --model gpt-4o-mini # Before: HTTP 400 'Encrypted content is not supported with this model' # After: responds normally --- agent/transports/codex.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/agent/transports/codex.py b/agent/transports/codex.py index 27264f2f38f56..000cad3f2c47f 100644 --- a/agent/transports/codex.py +++ b/agent/transports/codex.py @@ -80,8 +80,14 @@ def build_kwargs( is_xai_responses = params.get("is_xai_responses", False) # Resolve reasoning effort + # Default reasoning_enabled=False: non-reasoning models (gpt-4o-mini, + # gpt-4.1-mini, local MLX/Ollama, etc.) reject the Responses-API + # include[reasoning.encrypted_content] field with HTTP 400 "Encrypted + # content is not supported with this model." Reasoning-capable models + # (o1, o3, grok-thinking, etc.) still opt in via + # reasoning_config={"enabled": True} or {"effort": "medium"}. reasoning_effort = "medium" - reasoning_enabled = True + reasoning_enabled = False reasoning_config = params.get("reasoning_config") if reasoning_config and isinstance(reasoning_config, dict): if reasoning_config.get("enabled") is False: