The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(auxiliary): prioritize explicit reasoning config
fangliquan9f7df273a77a
diff --git a/agent/auxiliary_client.py b/agent/auxiliary_client.pyindex 33f229d816a..bfb17906c40 100644--- a/agent/auxiliary_client.py+++ b/agent/auxiliary_client.py@@ -6577,12 +6577,13 @@ def _build_call_kwargs(# main transport applies (#89503); MoA aggregator/reference and aux calls 400'd without it (#112010).from agent.reasoning_effort import clamp_reasoning_configfrom agent.auxiliary_reasoning_floor import known_reasoning_floor- if reasoning_config is None and isinstance(extra_body, dict):+ if isinstance(extra_body, dict):task_reasoning = extra_body.get("reasoning")if isinstance(task_reasoning, dict) and "enabled" in task_reasoning:- reasoning_config = task_reasoningextra_body = dict(extra_body)extra_body.pop("reasoning")+ if reasoning_config is None:+ reasoning_config = task_reasoningreasoning_config = clamp_reasoning_config(known_reasoning_floor(reasoning_config, provider_norm, effective_base, model, task))projection = _project_provider_profile(provider, provider_norm, model, effective_base, reasoning_config)diff --git a/tests/agent/test_auxiliary_client.py b/tests/agent/test_auxiliary_client.pyindex fa0f080da3a..322a80b76b7 100644--- a/tests/agent/test_auxiliary_client.py+++ b/tests/agent/test_auxiliary_client.py@@ -2554,6 +2554,25 @@ class TestAuxiliaryTaskExtraBody:assert kwargs["reasoning_effort"] == "low"assert "extra_body" not in kwargs or "reasoning" not in kwargs["extra_body"]+ def test_explicit_reasoning_config_replaces_task_reasoning_wire(self, monkeypatch):+ """A per-call config must not coexist with the task's normalized reasoning shape."""+ import agent.auxiliary_client as aux++ monkeypatch.setattr(aux, "_get_auxiliary_task_config", lambda _task: {"reasoning_effort": "none"})++ kwargs = aux._build_call_kwargs(+ provider="deepseek",+ model="deepseek-v4-flash",+ messages=[{"role": "user", "content": "hello"}],+ extra_body=aux._get_task_extra_body("compression"),+ reasoning_config={"enabled": True, "effort": "low"},+ task="compression",+ )++ assert kwargs["reasoning_effort"] == "low"+ assert kwargs["extra_body"]["thinking"] == {"type": "enabled"}+ assert "reasoning" not in kwargs["extra_body"]+def test_explicit_deepseek_thinking_disable_beats_profile_default(self):"""An explicit vendor control is authoritative when no normalized config is present."""import agent.auxiliary_client as aux