The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(auxiliary): forward service tier on Codex Responses
theo0a8b25e0ab77
diff --git a/agent/auxiliary_client.py b/agent/auxiliary_client.pyindex 0fbeec7e12d..46b376acd4f 100644--- a/agent/auxiliary_client.py+++ b/agent/auxiliary_client.py@@ -1656,6 +1656,25 @@ class _CodexCompletionsAdapter:# same behavior as the main agent's Codex transport.extra_body = kwargs.get("extra_body") or {}if isinstance(extra_body, dict):+ # Fast mode / Priority Processing is a top-level Responses field.+ # Auxiliary callers express provider controls through+ # auxiliary.<task>.extra_body, so project service_tier here just as+ # the main Codex transport projects request_overrides. xAI's+ # Responses endpoint rejects this field; keep the same xAI-only+ # guard as agent/transports/codex.py.+ service_tier = extra_body.get("service_tier")+ client_base_url = str(getattr(self._client, "base_url", "") or "")+ is_xai_responses = (+ base_url_host_matches(client_base_url, "x.ai")+ or base_url_host_matches(client_base_url, "api.x.ai")+ )+ if (+ isinstance(service_tier, str)+ and service_tier.strip()+ and not is_xai_responses+ ):+ resp_kwargs["service_tier"] = service_tier.strip()+reasoning_cfg = extra_body.get("reasoning")if isinstance(reasoning_cfg, dict):if reasoning_cfg.get("enabled") is False:diff --git a/tests/agent/test_auxiliary_client.py b/tests/agent/test_auxiliary_client.pyindex 2c4232a81f6..fecd60a5f7b 100644--- a/tests/agent/test_auxiliary_client.py+++ b/tests/agent/test_auxiliary_client.py@@ -3012,6 +3012,28 @@ class TestCodexAdapterPromptCacheKey:])assert "prompt_cache_retention" not in captured+ def test_codex_backend_forwards_auxiliary_service_tier(self):+ adapter, captured = self._build_adapter(+ base_url="https://chatgpt.com/backend-api/codex",+ model="gpt-5.6-luna",+ )+ adapter.create(+ messages=[{"role": "user", "content": "hi"}],+ extra_body={"service_tier": "priority"},+ )+ assert captured["service_tier"] == "priority"++ def test_xai_backend_drops_auxiliary_service_tier(self):+ adapter, captured = self._build_adapter(+ base_url="https://api.x.ai/v1",+ model="grok-4.6",+ )+ adapter.create(+ messages=[{"role": "user", "content": "hi"}],+ extra_body={"service_tier": "priority"},+ )+ assert "service_tier" not in captured+@pytest.mark.parametrize("base_url", ["https://api.openai.com/v1","https://example.services.ai.azure.com/openai/v1",