fix(providers): scope think to Ollama endpoints - #64286
Conversation
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
This PR scopes the think feature to Ollama endpoints.
Looks Good
- Targeted fix ensuring think behavior is Ollama-specific.
- Well-scoped: 6 files, minimal additions.
No Issues Found
Reviewed by Hermes Agent
teknium1
left a comment
There was a problem hiding this comment.
Thanks for targeting a real custom-provider compatibility issue. Current main still sends disabled-reasoning controls to every custom endpoint (plugins/model-providers/custom/__init__.py:57-65).
Problems
- Mainline commit
8662254ab2feadded top-levelreasoning_effort="none"besidethink=False. This PR predates it and only gatesthink(plugins/model-providers/custom/__init__.py:65-67ond9446975), so a salvage must scope both fields or generic relays can still receive an unsupported disabled-reasoning control. "ollama" in base_urland":11434" in base_urlare not positive endpoint identification (plugins/model-providers/custom/__init__.py:56-60). Currentdetect_local_server_type()verifies Ollama through/api/tags(agent/model_metadata.py:683-732).
Suggested changes
- Preserve the current Ollama
/v1fix while gating both disabled-case fields, with a transport-level generic-relay test asserting neither is sent. - Use an endpoint test that does not classify an arbitrary matching relay URL as Ollama.
Automated hermes-sweeper review.
d944697 to
4e1a167
Compare
|
Confirming that this breaks Groq endpoints (https://console.groq.com/home): I manually applied the fix from commit 4e1a167701427ef173565f7bd44c0b367def6554 onto my local Hermes install and it resolved the issue. Please merge the contributed fix! |
80557c5 to
62a0253
Compare
|
@teknium1 Thanks for the review. Both points are addressed, and the branch is rebased on current main (62a0253):
Targeted suites pass locally ( |
62a0253 to
92c4f9d
Compare
92c4f9d to
62de055
Compare
SummaryThirty-seven PRs address or reference this broad Ollama/provider-reasoning complex. Their diffs cover Ollama Cloud registration/catalog handling, surrogate and truncation recovery, Windows-adjacent work, reasoning propagation and capability scoping, and—most directly for the target—preventing Ollama-only disable controls from reaching heterogeneous custom endpoints. Related pull requests
Duplicates#3197 was absorbed by #10782 and later completed by #64608; #6038 and #10740 were also absorbed by #10782; #11296, #11362, #11395, #11520, #12488, and #12914 are old-path variants of the #11237 fix now best represented by #64286; #16192 was salvaged as #19881 and #16196 was superseded by it; #25866 and #29820 overlap, with #29820 salvaged as #64608; #55280, #55428, and #57601 overlap with merged #58156; #52613 and #59819 share suffix-key deduplication, but #59819 adds the endpoint-specific local-proxy behavior required by its recorded best-fix verdict; #65234 overlaps the disabled-field scope solved more robustly by #64286. Suggested consolidationKeep #64286 open with a salvage path: preserve its positive Complex graphflowchart TD
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I11237(["issue #11237 (open)"])
I65233(["issue #65233 (open)"])
I72649(["issue #72649 (open)"])
subgraph Dup11296 ["PRs duplicating each other"]
P11296["PR #11296 (open)"]
P11362["PR #11362 (open)"]
P11395["PR #11395 (closed)"]
P11520["PR #11520 (open)"]
P12488["PR #12488 (closed)"]
P12914["PR #12914 (closed)"]
P64286["PR #64286 (open)"]
P65234["PR #65234 (closed)"]
P72656["PR #72656 (open)"]
end
P64286 -->|best fix| I11237
P64286 -->|best fix| I65233
P64286 -->|best fix| I72649
class I11237 open
class I65233 open
class I72649 open
class P11296 open
class P11362 open
class P11395 closed
class P11520 open
class P12488 closed
class P12914 closed
class P64286 open
class P65234 closed
class P72656 open
class P64286 best
class P64286 best
class P64286 best
class P72656 best
class P64286 target
click I11237 "https://github.com/NousResearch/hermes-agent/issues/11237"
click I65233 "https://github.com/NousResearch/hermes-agent/issues/65233"
click I72649 "https://github.com/NousResearch/hermes-agent/issues/72649"
click P11296 "https://github.com/NousResearch/hermes-agent/pull/11296"
click P11362 "https://github.com/NousResearch/hermes-agent/pull/11362"
click P11395 "https://github.com/NousResearch/hermes-agent/pull/11395"
click P11520 "https://github.com/NousResearch/hermes-agent/pull/11520"
click P12488 "https://github.com/NousResearch/hermes-agent/pull/12488"
click P12914 "https://github.com/NousResearch/hermes-agent/pull/12914"
click P64286 "https://github.com/NousResearch/hermes-agent/pull/64286"
click P65234 "https://github.com/NousResearch/hermes-agent/pull/65234"
click P72656 "https://github.com/NousResearch/hermes-agent/pull/72656"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 37 pull requests and 16 issues in this complex. Each diff was read against this issue; Assessment working set: 331 kB of PR diffs, 187 kB of issue/PR text, 71 kB of discussion (93 comments), 74 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
What does this PR do?
Restricts Ollama-only disabled-reasoning controls to endpoints positively identified as Ollama.
When reasoning is disabled, a verified Ollama endpoint receives both
extra_body.think=falseand top-levelreasoning_effort="none". Generic OpenAI-compatible custom relays receive neither field, while explicit enabled reasoning effort remains available for custom reasoning APIs. Ollama detection uses the existing/api/tagsprobe instead of URL substrings or port numbers.Related Issue
Fixes #11237.
Related/overlapping work:
thinksymptom but identifies Ollama from URL text/port. This PR uses positive/api/tagsdetection to avoid misclassifying arbitrary relays.reasoning_effortbehavior; this PR scopes that field under the same verified-Ollama predicate asthink.Type of Change
Changes Made
plugins/model-providers/custom/__init__.py: identify Ollama throughdetect_local_server_type(base_url, api_key); scope both disabled controls to verified Ollama endpoints.agent/chat_completion_helpers.pyandagent/transports/chat_completions.py: thread the API key through provider-profile and retry/fallback request construction.agent/auxiliary_client.py: keep auxiliary request construction in parity with the main transport path.tests/agent/,tests/plugins/model_providers/, andtests/providers/: cover Ollama, misleading URLs/ports, generic relays, API-key propagation, auxiliary requests, and retry/transport parity.How to Test
scripts/run_tests.sh tests/plugins/model_providers/test_custom_profile.py tests/providers/test_transport_parity.py tests/agent/transports/test_chat_completions.py tests/agent/test_auxiliary_client.py tests/agent/test_probe_cache_followups.py -q.think=falseandreasoning_effort="none".ollamaor using port 11434 without a valid/api/tagsresponse—receive neither disabled field.Focused result: 240 passed.
Additional checks:
ruff check .,git diff --check, andscripts/check-windows-footguns.py --allpass.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests pass (focused affected suites pass; the full GitHub Actions matrix is awaiting maintainer approval)Documentation & Housekeeping
docs/, docstrings) — N/A; no user-facing interface or behavior documentation changedcli-config.yaml.exampleif I added/changed config keys — N/A; no configuration keys changedCONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/A; no architecture or workflow changedScreenshots / Logs
N/A — regression coverage and command results are listed above.
AI Assistance
OpenAI — GPT-5 via Codex CLI (implementation assistance, test execution, and PR-description drafting).