fix(custom-profile): omit reasoning_effort="none" for remote endpoints - #65234
Closed
ajzrva-sys wants to merge 2 commits into
Closed
fix(custom-profile): omit reasoning_effort="none" for remote endpoints#65234ajzrva-sys wants to merge 2 commits into
ajzrva-sys wants to merge 2 commits into
Conversation
ajzrva-sys
force-pushed
the
fix/custom-profile-remote-reasoning-effort
branch
from
July 15, 2026 22:17
72e078b to
fe41553
Compare
CustomProfile.build_api_kwargs_extras() unconditionally sent reasoning_effort="none" + think=False when reasoning was disabled. This is correct for local Ollama but breaks remote OpenAI-compatible APIs (ofox, Volcengine ARK, etc.) that reject "none" as invalid. Only emit both fields for local endpoints (localhost/127.0.0.1). Remote endpoints get neither — server default applies. Fixes NousResearch#65233 Related: NousResearch#59660
ajzrva-sys
force-pushed
the
fix/custom-profile-remote-reasoning-effort
branch
from
July 15, 2026 22:21
fe41553 to
5ef4206
Compare
teknium1
reviewed
Jul 16, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for isolating the current custom-profile wire regression; current main does unconditionally emit both disable fields at plugins/model-providers/custom/__init__.py:57-65.
Problems
plugins/model-providers/custom/__init__.py:126uses endpoint locality as the capability test. The custom provider is documented to target any OpenAI-compatible endpoint (website/docs/integrations/providers.md:570), so locality does not establish whether an endpoint acceptsreasoning_effort="none"orthink. It also changes an explicit disabled setting into server-default behavior for every remote endpoint (PR lines 106-108), matching the concern raised in #65233's discussion.- The new remote assertions invoke the profile directly (
tests/plugins/model_providers/test_custom_profile.py:73-78). The production wire path is assembled inagent/transports/chat_completions.py:582-611; add a transport-level regression test for the final kwargs.
Suggested changes
- Model disabling support as an explicit custom-endpoint capability/profile decision rather than a hostname classification, retaining the Ollama-specific path where it is known to be required.
- Cover both supported-disable and unsupported-disable endpoint cases through
transport.build_kwargs.
Automated hermes-sweeper review.
| # Only send reasoning_effort="none" + think=False to LOCAL | ||
| # endpoints (Ollama, local vLLM/llama.cpp). Remote endpoints | ||
| # reject "none" as invalid — omit entirely so server default applies. | ||
| if _is_local: |
Contributor
There was a problem hiding this comment.
This branch infers API parameter support from network locality, but provider=custom is documented for arbitrary OpenAI-compatible endpoints (website/docs/integrations/providers.md:570). A local proxy can reject these fields and a remote endpoint can support them; please select this behavior through an explicit endpoint/provider capability instead, so enabled: false is not silently converted to an endpoint default based only on its hostname.
…om locality Replace the hostname-based locality heuristic with an explicit per-provider config key reasoning_disable: "auto" (default) — locality heuristic (send to local, omit for remote) "none" — always send reasoning_effort="none" + think=False "omit" — never send the disable fields A remote endpoint may accept reasoning_effort="none" (e.g. vLLM in the cloud) and a local proxy may reject it (e.g. llama.cpp). The locality heuristic is a guess — explicit config lets the user decide. 3 new tests: disable=none forces on remote, disable=omit suppresses on local, disable=auto preserves existing locality behavior. Fixes NousResearch#65233
This was referenced Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #65233
Related: #59660
Problem
CustomProfile.build_api_kwargs_extras() unconditionally sent
reasoning_effort="none"+think=Falsewhen reasoning was disabled. Remote OpenAI-compatible APIs (ofox, Volcengine ARK, Doubao, etc.) rejectreasoning_effort="none"as invalid — HTTP 400.Fix
Only emit both fields for local endpoints. Remote endpoints get neither — server default applies.
Local endpoint detection (proper, not substring matching)
urlparsefor hostname extraction — avoids false positives likehttps://localhost.example.combeing treated as locallocalhost,ip6-localhost,ip6-loopback,0.0.0.0,::,::1[::1],[::]recognizedipaddressmodule.localdomains: Bonjour/Avahi (Ollama on other Macs, AirDrop)base_url→ default to local (backward compat with legacy tests that don’t pass base_url)Wire behavior
reasoning_effort="none",think=Falsereasoning_effort="none",think=Falsereasoning_effort=<effort>(passed through)Testing
enabled=Falseandeffort="none"paths