Skip to content

fix: respect reasoning_config effort for custom providers - #49607

Closed
zackzmai wants to merge 1 commit into
NousResearch:mainfrom
zackzmai:fix/custom-provider-reasoning-effort
Closed

fix: respect reasoning_config effort for custom providers#49607
zackzmai wants to merge 1 commit into
NousResearch:mainfrom
zackzmai:fix/custom-provider-reasoning-effort

Conversation

@zackzmai

Copy link
Copy Markdown

Problem

/reasoning high doesn'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"} ignoring reasoning_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: true in config.yaml so custom providers can opt in to reasoning support.

Tests

  • test_reasoning_effort_from_config - effort propagation for all levels
  • test_reasoning_effort_invalid_falls_back_to_medium - invalid values degrade gracefully
  • test_custom_provider_model_reasoning_opt_in - reasoning: true enables gate
  • test_custom_provider_without_reasoning_flag_returns_false - backwards compat

All 83 transport tests + 3 reasoning gate tests pass.

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
@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists labels Jun 20, 2026
@zackzmai

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants