mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-08 13:12:08 +00:00
PR #57601's original branch added a top-level reasoning_effort emit to the LEGACY build_kwargs path (agent/transports/chat_completions.py), but provider=custom resolves to CustomProfile (plugins/model-providers/custom/), so chat_completion_helpers takes the profile path and returns early — the added branch was unreachable dead code for every custom endpoint. Move the fix to its real site, CustomProfile.build_api_kwargs_extras(), and follow the DeepSeek/Zai profile precedent: - disabled -> extra_body.think = False (unchanged) - enabled + effort -> TOP-LEVEL reasoning_effort (the OpenAI-compatible format GLM-5.2/ARK expect), passed through verbatim incl. max/xhigh - enabled + no effort -> omit, so the endpoint's server default applies (avoids silently forcing 'medium' as the original branch did) Deliberately does NOT force think=True on enable — that flag is Ollama-only and risks a 400 on GLM/vLLM endpoints that don't recognize it; thinking is already server-default-on for these backends. Verified end-to-end through the real profile dispatch (temp HERMES_HOME): custom+high -> reasoning_effort=high; custom+max -> reasoning_effort=max; custom+none -> think=False; custom+unset -> nothing; num_ctx composes. Adds tests/plugins/model_providers/test_custom_profile.py (13 cases). Addresses the custom-provider half of #55276. Co-authored-by: huanshan5195 <huanshan5195@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| test_custom_profile.py | ||
| test_deepseek_profile.py | ||
| test_kimi_profile.py | ||
| test_minimax_profile.py | ||
| test_ollama_cloud_profile.py | ||
| test_opencode_go_profile.py | ||
| test_zai_profile.py | ||