The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
Merge remote-tracking branch 'origin/main' into fix/hermes-relay-review-round3
Alex Fournier8ac686fa27af
diff --cc agent/chat_completion_helpers.pyindex 40fdaa57fe1,b0c3faaf6f7..fff41a86236--- a/agent/chat_completion_helpers.py+++ b/agent/chat_completion_helpers.py@@@ -2153,15 -2163,13 +2192,22 @@@ def handle_max_iterations(agent, messagif agent.api_mode == "anthropic_messages":_tsum = agent._get_transport()-- _ant_kw = _tsum.build_kwargs(model=agent.model, messages=api_messages, tools=None,-- max_tokens=agent.max_tokens, reasoning_config=agent.reasoning_config,-- is_oauth=agent._is_anthropic_oauth,- preserve_dots=agent._anthropic_preserve_dots())- preserve_dots=agent._anthropic_preserve_dots(),- base_url=getattr(agent, "_anthropic_base_url", None))++ _ant_kw = _tsum.build_kwargs(++ model=agent.model,++ messages=api_messages,++ tools=None,++ max_tokens=agent.max_tokens,++ reasoning_config=agent.reasoning_config,++ is_oauth=agent._is_anthropic_oauth,++ preserve_dots=agent._anthropic_preserve_dots(),++ base_url=getattr(agent, "_anthropic_base_url", None),++ )+ _ant_kw = _merge_nous_portal_messages_extra_body(agent, _ant_kw)- summary_response = agent._anthropic_messages_create(_ant_kw)+ summary_response = _managed_summary_call(+ _ant_kw,+ agent._anthropic_messages_create,+ retry_count=0,+ )_summary_result = _tsum.normalize_response(summary_response, strip_tool_prefix=agent._is_anthropic_oauth)final_response = (_summary_result.content or "").strip()else:@@@ -2195,15 -2195,13 +2241,22 @@@final_response = (_cnr_retry.content or "").strip()elif agent.api_mode == "anthropic_messages":_tretry = agent._get_transport()-- _ant_kw2 = _tretry.build_kwargs(model=agent.model, messages=api_messages, tools=None,-- is_oauth=agent._is_anthropic_oauth,-- max_tokens=agent.max_tokens, reasoning_config=agent.reasoning_config,- preserve_dots=agent._anthropic_preserve_dots())- preserve_dots=agent._anthropic_preserve_dots(),- base_url=getattr(agent, "_anthropic_base_url", None))++ _ant_kw2 = _tretry.build_kwargs(++ model=agent.model,++ messages=api_messages,++ tools=None,++ is_oauth=agent._is_anthropic_oauth,++ max_tokens=agent.max_tokens,++ reasoning_config=agent.reasoning_config,++ preserve_dots=agent._anthropic_preserve_dots(),++ base_url=getattr(agent, "_anthropic_base_url", None),++ )+ _ant_kw2 = _merge_nous_portal_messages_extra_body(agent, _ant_kw2)- retry_response = agent._anthropic_messages_create(_ant_kw2)+ retry_response = _managed_summary_call(+ _ant_kw2,+ agent._anthropic_messages_create,+ retry_count=1,+ )_retry_result = _tretry.normalize_response(retry_response, strip_tool_prefix=agent._is_anthropic_oauth)final_response = (_retry_result.content or "").strip()else: