hermes-agent/tests/plugins/model_providers
kshitijk4poor 5d9a72b7c2 fix(ollama-cloud): capability-gate reasoning_effort + correct disable semantics
Three follow-up fixes to the salvaged reasoning_effort support, all verified
live against ollama.com /v1/chat/completions + /api/show on deepseek-v4-pro,
gemma3, and qwen3-coder:

1. Capability-gate on /api/show 'thinking'. The original ignored the
   supports_reasoning flag and emitted reasoning_effort for every model. Now
   gated: only models whose native /api/show capabilities list contains
   'thinking' (deepseek-v4 yes; gemma3 / qwen3-coder no) get reasoning_effort.
   Mirrors the LM Studio pattern — capability resolved once per (model,
   base_url) in run_agent._supports_reasoning_extra_body via a cached probe
   (hermes_cli.models.ollama_model_supports_thinking), threaded into the
   profile hook as supports_reasoning. No live HTTP in the per-request path.

2. Disable actually disables. Ollama Cloud defaults to thinking ON and IGNORES
   the extra_body.thinking:{type:disabled} shape (verified: still returned
   reasoning). The only working off switch is top-level reasoning_effort:'none'.
   The salvaged code returned ({}, {}) for enabled:false / effort:none, leaving
   thinking ON. Now emits {'reasoning_effort': 'none'}.

3. Omit unrecognized effort. The original forwarded any unknown string verbatim
   including 'minimal' (a real Hermes effort level). Ollama Cloud rejects
   unrecognized values with a hard HTTP 400 (accepted set: low/medium/high/
   max/none), so forwarding 'minimal' would break the request. Now omitted.

Core touches (run_agent.py, hermes_cli/models.py) add the capability probe;
the plugin profile only consumes the resolved flag. 24/24 profile tests green;
194 provider/transport tests unaffected.
2026-07-16 07:58:04 -07:00
..
test_custom_profile.py fix(ollama): emit top-level reasoning_effort=none on /v1/chat/completions (#25758) 2026-07-15 06:38:28 -07:00
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_fireworks_profile.py fix(providers): align Fireworks integration with project policy 2026-07-11 05:43:35 -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 fix(ollama-cloud): capability-gate reasoning_effort + correct disable semantics 2026-07-16 07:58:04 -07:00
test_opencode_go_profile.py feat(providers): GLM-5.2 native reasoning_effort controls (#58884) 2026-07-05 13:48:01 -07:00
test_upstage_profile.py fix(upstage): collapse unknown future efforts to high; behavior-contract tests 2026-07-15 00:09:24 +05:30
test_zai_profile.py feat(providers): GLM-5.2 native reasoning_effort controls (#58884) 2026-07-05 13:48:01 -07:00