The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(agent): drop the unwritten runtime_capabilities answer_in_reasoning branch
kshitijk4poor246a1e2eecb8
diff --git a/agent/reasoning_promotion.py b/agent/reasoning_promotion.pyindex af6fe68a549..9179f1572c5 100644--- a/agent/reasoning_promotion.py+++ b/agent/reasoning_promotion.py@@ -19,8 +19,7 @@ _NEMOTRON_PARSER_MODEL_MARKER = "nemotron-3.5-lightning"def answer_in_reasoning_capability(agent: Any) -> bool:"""True when the live route may return a clean-stop reasoning payload as the answer.- Trusted: an explicit ``answer_in_reasoning`` bool in ``runtime_capabilities``, a- custom_providers per-model ``answer_in_reasoning`` opt-in or provider-level+ Trusted: a custom_providers per-model ``answer_in_reasoning`` opt-in or provider-level``capabilities: {answer_in_reasoning: ...}`` block on the live route, or the localNemotron-3.5-Lightning parser route from #109205. OpenRouter and non-chat-completionstransports are never trusted.@@ -34,16 +33,8 @@ def answer_in_reasoning_capability(agent: Any) -> bool:if api_mode and api_mode != "chat_completions":return False- runtime_capabilities = getattr(agent, "runtime_capabilities", None)- if isinstance(runtime_capabilities, dict):- configured = runtime_capabilities.get(_ANSWER_IN_REASONING_CAPABILITY)- if isinstance(configured, bool):- return configured-# Returns None on unreadable config, so no guard is needed here.- from hermes_cli.config import get_custom_provider_model_capability-- from hermes_cli.config_providers import _entries_for_route+ from hermes_cli.config import _entries_for_route, get_custom_provider_model_capabilitymodel = str(getattr(agent, "model", "") or "")custom_providers = getattr(agent, "_custom_providers", None)diff --git a/tests/agent/test_run_agent.py b/tests/agent/test_run_agent.pyindex 758e3371a79..0513ed72cca 100644--- a/tests/agent/test_run_agent.py+++ b/tests/agent/test_run_agent.py@@ -3498,8 +3498,8 @@ class TestRunConversation:def test_reasoning_only_local_clean_stop_returns_immediately(self, agent):"""A clean-stop reasoning answer returns without compression or recovery."""self._setup_agent(agent)- agent.runtime_capabilities["answer_in_reasoning"] = Trueagent.base_url = "http://127.0.0.1:1234/v1"+ agent._custom_providers = [{"base_url": agent.base_url, "capabilities": {"answer_in_reasoning": True}}]agent.compression_enabled = Trueempty_resp = _mock_response(content=None,