fix: respect reasoning_config effort for custom providers - #49607
Closed
zackzmai wants to merge 1 commit into
Closed
fix: respect reasoning_config effort for custom providers#49607zackzmai wants to merge 1 commit into
zackzmai wants to merge 1 commit into
Conversation
Two bugs prevented custom providers (CLIProxyAPI, vLLM, Ollama, etc.)
from using /reasoning with the correct effort level:
1. chat_completions transport hardcoded effort to "medium" regardless
of reasoning_config. Now reads effort from reasoning_config when
provided, falling back to "medium" for invalid/missing values.
2. _supports_reasoning_extra_body() acted as a whitelist gate that only
returned True for Nous/GitHub/LMStudio/OpenRouter. Custom providers
had no way to opt in. Now checks providers.<name>.models.<model>.
reasoning: true in config.yaml, allowing users to declare reasoning
support for any custom endpoint.
Config example:
providers:
cliproxyapi:
models:
mimo-v2.5-pro:
reasoning: true
context_length: 131072
Author
|
Closing — the fix doesn't work end-to-end for custom providers. The core issue is deeper than these two files: is normalized to for ALL custom providers, making config-based opt-in matching unreliable. Needs a different approach. |
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.
Problem
/reasoning highdoesn't work for custom providers (CLIProxyAPI, vLLM, Ollama, etc.). Two bugs:Bug 1: Effort hardcoded to "medium" (
chat_completions.py:424)Transport emits
extra_body["reasoning"] = {"enabled": True, "effort": "medium"}ignoringreasoning_config.Bug 2: Custom providers blocked by whitelist gate (
run_agent.py:4842)_supports_reasoning_extra_body()only returns True for Nous/GitHub/LMStudio/OpenRouter. Custom providers always get False.Fix
Fix 1 - Read effort from
reasoning_config, fallback to "medium".Fix 2 - Check
providers.<name>.models.<model>.reasoning: truein config.yaml so custom providers can opt in to reasoning support.Tests
test_reasoning_effort_from_config- effort propagation for all levelstest_reasoning_effort_invalid_falls_back_to_medium- invalid values degrade gracefullytest_custom_provider_model_reasoning_opt_in- reasoning: true enables gatetest_custom_provider_without_reasoning_flag_returns_false- backwards compatAll 83 transport tests + 3 reasoning gate tests pass.