Skip to content

reasoning_effort none does not disable thinking on OpenAI-compatible / DeepSeek gateways (LiteLLM) #2020

Closed

Description

@osmanaksu

Summary

Setting the reasoning effort to none does not actually turn thinking off for OpenAI-compatible / DeepSeek-style endpoints served through gateways such as LiteLLM. Jcode omits the reasoning_effort field from the request body when the effort is none, and LiteLLM (and DeepSeek-V3+) default thinking to ON when that field is absent — so none silently leaves thinking enabled.

Reproduced on deepseek-reasoner via a LiteLLM profile with supports-reasoning-effort = true.

Steps to reproduce

  1. Configure a LiteLLM profile:
    default_provider = "litellm"
    [providers.litellm]
    type = "openai-compatible"
    base-url = "http://127.0.0.1:4000/v1"
    models = [
      { id = "deepseek-reasoner", reasoning = true, reasoning-effort = "low" },
    ]
    supports-reasoning-effort = true
  2. Start a session on that profile/model.
  3. Set the effort to none (via /effort none or openai_reasoning_effort = "none").
  4. Send any prompt.

Expected

none disables thinking: no reasoning_content tokens, fast response.

Actual

Thinking still runs (visible 💭 reasoning stream, full latency).

Root cause: OpenRouterProvider::apply_resolved_reasoning_effort (crates/jcode-provider-openrouter-runtime/src/lib.rs) drops the field for none in both the DeepSeek-style and OpenAI-style branches:

if effort == "none" {
    return false;   // field omitted from the request body
}
request["reasoning_effort"] = serde_json::json!(effort);

Wire-level proof (curl against the LiteLLM proxy)

Same prompt, only the reasoning_effort field differs:

Request body reasoning_content length
field absent (current none behavior) 135 (thinking ON)
"reasoning_effort": "none" 0 (thinking OFF)

So the gateway honors an explicit "none"; the bug is purely that Jcode omits the field.

TUI proof (selfdev build)

  • effort low → "The user is asking me to reply…" + hi, 9.1s (thinking visible)
  • effort none → just hello, 2.3s (no thinking) — after the fix

Proposed fix

Send reasoning_effort: "none" explicitly instead of omitting the field, in both the DeepSeek-style and OpenAI-style branches of apply_resolved_reasoning_effort. Small, focused change with a new LiteLLM + deepseek-reasoner + none wire regression test

Activity

  1. added
    bug
    triage: fixed
    on Nov 2, 2026
  2. 1jehuang commented on Nov 2, 2026

    @1jehuang
    Owner

    Fixed in 5fedab8, now on master. OpenAI-compatible profiles explicitly opting into supports-reasoning-effort now send reasoning_effort: "none" instead of omitting it. Built-in/heuristic behavior and model-level opt-outs are preserved. Hosted check passed, the provider suite passed 195 tests (1 ignored), and a seven-case HTTP wire regression matrix passed, including LiteLLM-style DeepSeek/GPT through the public effort setter. This verifies the outgoing request contract, not a live LiteLLM deployment. Thanks for the wire-level reproduction!


    Jcode agent (automated triage), on behalf of @1jehuang

  3. added a commit that references this issue on Nov 2, 2026
    5fedab8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtriage: fixed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions