The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(commandcode): resolve the native DeepSeek profile through the registry
kshitijk4pooref754d75bac2
diff --git a/plugins/model-providers/commandcode/__init__.py b/plugins/model-providers/commandcode/__init__.pyindex 0f57962c251..bd2aebbe05f 100644--- a/plugins/model-providers/commandcode/__init__.py+++ b/plugins/model-providers/commandcode/__init__.py@@ -7,7 +7,7 @@ import loggingimport urllib.requestfrom hermes_cli.urllib_security import open_credentialed_url-from providers import register_provider+from providers import get_provider_profile, register_providerfrom providers.base import ProviderProfile, _profile_user_agentlogger = logging.getLogger(__name__)@@ -47,11 +47,14 @@ class CommandCodeProfile(ProviderProfile):without them ``/reasoning`` never reaches the request (#95232). Other modelfamilies stay a no-op — CommandCode declares no reasoning vocabulary for them."""m = (model or "").strip()- if not m.lower().startswith("deepseek/") or len(m) <= len("deepseek/"):+ if not m.lower().startswith("deepseek/"):return {}, {}- from plugins.model_providers.deepseek import deepseek as _deepseek_profile-- return _deepseek_profile.build_api_kwargs_extras(+ # Registry lookup, not a module import: the deepseek shim is only a loader-injected+ # sys.modules entry, and the registry honours a user override of the profile.+ native = get_provider_profile("deepseek")+ if native is None:+ return {}, {}+ return native.build_api_kwargs_extras(reasoning_config=reasoning_config, model=m.split("/", 1)[1], **context,)diff --git a/tests/plugins/model_providers/test_commandcode_profile.py b/tests/plugins/model_providers/test_commandcode_profile.pyindex dd7537e19f9..f33e58fd161 100644--- a/tests/plugins/model_providers/test_commandcode_profile.py+++ b/tests/plugins/model_providers/test_commandcode_profile.py@@ -100,9 +100,11 @@ class TestCommandCodeReasoningWireControls:from plugins.model_providers.deepseek import deepseekrc = {"enabled": True, "effort": "low"}+ expected = deepseek.build_api_kwargs_extras(reasoning_config=rc, model="deepseek-v4.1-flash")+ assert expected[1].get("reasoning_effort") == "low" # equality below must not be ({}, {}) == ({}, {})assert commandcode_profile.build_api_kwargs_extras(reasoning_config=rc, model="deepseek/deepseek-v4.1-flash"- ) == deepseek.build_api_kwargs_extras(reasoning_config=rc, model="deepseek-v4.1-flash")+ ) == expectedassert commandcode_profile.build_api_kwargs_extras(reasoning_config=rc, model="Qwen/Qwen3.7-Max") == ({}, {})