hermes-agent/tests/plugins/model_providers
kshitijk4poor 67df958dbe fix(custom-provider): emit reasoning_effort at the live profile path
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>
2026-07-04 14:19:44 +05:30
..
test_custom_profile.py fix(custom-provider): emit reasoning_effort at the live profile path 2026-07-04 14:19:44 +05:30
test_deepseek_profile.py fix(deepseek): set default_aux_model on profile so aux warning stops firing 2026-05-16 22:54:22 -07:00
test_kimi_profile.py fix(kimi): send thinking xor reasoning_effort, never both 2026-06-07 01:24:29 -07:00
test_minimax_profile.py fix: route minimax m3 reasoning controls through profile 2026-06-15 07:08:43 -07:00
test_ollama_cloud_profile.py feat: add reasoning_effort support to ollama-cloud provider 2026-06-23 11:51:43 -07:00
test_opencode_go_profile.py fix(opencode-go): gate thinking when reasoning_effort set to avoid HTTP 400 2026-06-07 01:24:29 -07:00
test_zai_profile.py fix(desktop,tui-gateway,zai): stop thinking-off from reverting to medium 2026-07-02 15:23:47 -05:00