Repository navigation
Description
Maintainer correction and scope clarification
The original report combines three behaviors, but its metadata diagnosis is not established for the normal authenticated managed-proxy path.
The synthetic reproduction intentionally returns an empty list from /v1/model/info. That proves fallback behavior when proxy metadata is unavailable; it does not prove that metadata is unavailable in production. An authenticated query to the managed proxy returns the deepseek-v4.1-flash alias, token limits, supports_reasoning: true, and litellm_params.allowed_openai_params: ["reasoning_effort"].
There is nevertheless a real metadata-contract gap: the SDK extracts only current["model_info"] from a /v1/model/info entry and discards litellm_params.allowed_openai_params. That general problem is tracked in #5499 and should be addressed before adding model-name-specific fallbacks.
This issue is therefore narrowed to two independently demonstrated SDK behaviors:
- The SDK must not convert an advertised maximum output size into the default
max_completion_tokenssent on every request. Doing so can make lower-limit OpenRouter providers ineligible. - When an explicit OpenHands capability override enables
reasoning_effort, the SDK must translate that contract into the corresponding LiteLLM allowance sodrop_params=Truedoes not silently remove it.
A DeepSeek-specific hardcoded alias fallback is not an acceptance criterion here unless an authenticated production-like reproduction demonstrates that the general proxy metadata contract cannot represent or deliver the capability.
Revised acceptance criteria
- An advertised
max_output_tokensis treated as a limit, not automatically sent as the default requested completion size. - Explicit user configuration of
max_output_tokensremains authoritative. -
capability_overrides={"supports_reasoning_effort": True}causesreasoning_effortto reach a generic OpenAI-compatible request through the appropriate LiteLLM allowance. - Without the explicit override or authoritative capability metadata, unsupported or unknown routes do not receive
reasoning_effort. - Tests cover both behaviors without depending on hardcoded DeepSeek alias names where a general mechanism is sufficient.
- Any proposed alias-specific fallback includes an authenticated production-like reproduction and explains why consuming proxy-advertised parameter capabilities is insufficient.
Original report
Is there an existing issue for the same bug?
- I have searched existing issues and this is not a duplicate.
Related:
- SDK sends unsupported reasoning_effort to MiniMax M3 #4934: stop sending
reasoning_effortbased on genericsupports_reasoning. It interacts with (1) below. - feat: register deepseek-v4.1-flash as a verified model #4941:
deepseek-v4.1-flashbecame the default Cloud model. - [Bug] SDK effective_max_output_tokens exceeds actual model limits for non-Bedrock providers (moonshot, deepseek via custom base_url) #3317: the effective max output tokens exceed real provider limits. It relates to (2).
Bug Description
The SDK derives reasoning_effort support and the default output cap for DeepSeek V4.x from proxy or LiteLLM metadata. The result depends on whether that metadata exists, and it is wrong either way:
- Without proxy metadata,
reasoning_effortis dropped foropenhands/deepseek-v4.1-flashandlitellm_proxy/deepseek-v4.1-flash.get_supported_openai_paramsreturns nothing for bare DeepSeek ids, and LiteLLM 1.93 has no registry entry fordeepseek-v4.1-flash, so support falls back toFalse.deepseek-v4-flashand-v4-proonly work because LiteLLM's registry marks themsupports_reasoning: true.- A proxy alias with
model_info(like OpenHands' hosted proxy) masks the problem. It shows up on proxies without the alias, or when/v1/model/infofails. The fix proposed in SDK sends unsupported reasoning_effort to MiniMax M3 #4934 would expose it for v4-flash, v4-pro and v4.1-flash everywhere.
- With proxy metadata, the SDK sends
max_completion_tokensequal to the model's advertised maximum (e.g.max_output_tokens: 384000) on every request.- On OpenRouter, that silently excludes endpoints with lower limits, so provider pins configured on the proxy stop working.
- Example: an alias pinning
provider.order: ["Baseten"](limit 32,768) falls back to other providers.
- On
openai/…routes,capability_overrides={"supports_reasoning_effort": True}has no effect. LiteLLM's defaultdrop_params=Trueremoves the parameter for OpenAI-compatible endpoints.
Expected Behavior
reasoning_effortis sent for DeepSeek V4.x onopenhands/andlitellm_proxy/routes without relying on proxy metadata or genericsupports_reasoning.- The SDK does not send, by default, an output cap larger than the route can serve.
- When
capability_overridesenablesreasoning_effort, the parameter reaches the request body (e.g. viaallowed_openai_params).
Actual Behavior
Offline repro against a fake OpenAI-compatible server with no model metadata (script below), on main @ 28e8ed2 with LiteLLM 1.93.0:
$ uv run python repro_wire.py
openhands/deepseek-v4-flash overrides=None -> reasoning_effort on the wire: 'high'
openhands/deepseek-v4.1-flash overrides=None -> reasoning_effort on the wire: None
litellm_proxy/deepseek-v4.1-flash overrides=None -> reasoning_effort on the wire: None
openai/openrouter/deepseek/deepseek-v4.1-flash overrides=None -> reasoning_effort on the wire: None
openai/openrouter/deepseek/deepseek-v4.1-flash overrides={'supports_reasoning_effort': True} -> reasoning_effort on the wire: None
For (2), the probe went through a LiteLLM proxy to OpenRouter's deepseek/deepseek-v4.1-flash:
provider |
max_completion_tokens |
Result |
|---|---|---|
order: ["Baseten"], no fallbacks |
not set | served by Baseten |
order: ["Baseten"], no fallbacks |
384000 | 404 "No endpoints found" |
order: [..., "Baseten"], with fallbacks |
384000 | served by another provider (Morph) |
Steps to Reproduce
- Save the script below as
repro_wire.pyin a checkout ofmain. uv run python repro_wire.py- For (2), send the requests in the table through any LiteLLM proxy that has an OpenRouter key.
Acceptance Criteria
-
openhands/deepseek-v4.1-flashandlitellm_proxy/deepseek-v4.1-flashsendreasoning_effortwith no proxy metadata (the repro prints'high'). -
deepseek-v4-flashand-v4-prokeep sending it without depending on genericsupports_reasoning, so the fix composes with SDK sends unsupported reasoning_effort to MiniMax M3 #4934. - With metadata advertising
max_output_tokens: 384000, the SDK does not send that value as a default cap, unless the user configured it. -
openai/…pluscapability_overrides={"supports_reasoning_effort": True}sendsreasoning_effort. Behavior without the override is unchanged. -
reasoning_effortis still not sent where support is unknown or negative (no regression of SDK sends unsupported reasoning_effort to MiniMax M3 #4934). - Unit tests cover the no-metadata, with-metadata and
openai/-with-override cases.
Installation Method
uv (repository checkout)
SDK Version
1.49.2 (main @ 28e8ed2)
Version Confirmation
- I have confirmed this bug exists on the LATEST version of OpenHands SDK
Python Version
3.12
Model Name (if applicable)
deepseek-v4.1-flash (openhands/, litellm_proxy/, openai/openrouter/…)
Operating System
MacOS
Logs and Error Messages
Nothing is logged; the parameter is silently absent. Calling LiteLLM directly with drop_params=False shows the drop on the openai/ route:
litellm.UnsupportedParamsError: openai does not support parameters: ['reasoning_effort'], for model=openrouter/deepseek/deepseek-v4.1-flash.
... If you want to use these params dynamically send allowed_openai_params=['reasoning_effort'] in your request.
Minimal Code Sample
import json
import threading
from http.server import BaseHTTPRequestHandler, HTTPServer
from openhands.sdk import LLM
from openhands.sdk.llm import Message, TextContent
bodies = []
class FakeOpenAICompatibleServer(BaseHTTPRequestHandler):
def do_GET(self): # /v1/model/info probe: no metadata
self._send({"data": []})
def do_POST(self):
bodies.append(json.loads(self.rfile.read(int(self.headers["Content-Length"]))))
self._send({"id": "x", "object": "chat.completion", "created": 1, "model": "m",
"choices": [{"index": 0, "message": {"role": "assistant", "content": "ok"}, "finish_reason": "stop"}],
"usage": {"prompt_tokens": 1, "completion_tokens": 1, "total_tokens": 2}})
def _send(self, payload):
data = json.dumps(payload).encode()
self.send_response(200)
self.send_header("Content-Type", "application/json")
self.send_header("Content-Length", str(len(data)))
self.end_headers()
self.wfile.write(data)
def log_message(self, *args):
pass
server = HTTPServer(("127.0.0.1", 0), FakeOpenAICompatibleServer)
threading.Thread(target=server.serve_forever, daemon=True).start()
cases = [
("openhands/deepseek-v4-flash", None),
("openhands/deepseek-v4.1-flash", None),
("litellm_proxy/deepseek-v4.1-flash", None),
("openai/openrouter/deepseek/deepseek-v4.1-flash", None),
("openai/openrouter/deepseek/deepseek-v4.1-flash", {"supports_reasoning_effort": True}),
]
for model, overrides in cases:
llm = LLM(model=model, api_key="x", base_url=f"http://127.0.0.1:{server.server_port}/v1",
reasoning_effort="high", capability_overrides=overrides or {}, usage_id=model + str(overrides))
llm.completion([Message(role="user", content=[TextContent(text="hi")])])
print(f"{model:50} overrides={overrides} -> reasoning_effort on the wire: {bodies[-1].get('reasoning_effort')!r}")Screenshots and Additional Context
- DeepSeek documents the parameter.
reasoning_efforttakesnone/low/high/max, defaulthigh(docs). In pinned-provider probes (DeepSeek, DeepInfra),nonegave 0 reasoning tokens, and leaving it unset behaved likehigh. So with the defaulthighthe loss is invisible, but any other level is silently ignored. - Workaround:
litellm_proxy/openrouter/deepseek/deepseek-v4.1-flashresolves support and sendsreasoning_effort. Setmax_output_tokensexplicitly to avoid the advertised 384,000 cap. - Out of scope: LiteLLM's native
deepseek/provider maps effort to thinking on/off, which is an upstream LiteLLM behavior.
Filed by an AI agent (Claude Code) on behalf of @simonrosenberg.
Activity
github-actions commentedon Sep 18, 2026
✅
ready-for-devlabel appliedThis issue meets the readiness criteria and is ready for contribution.
A contributor can now open a PR that links this issue (
Fixes #<number>).This is an automated check — no AI was used to generate this comment.
all-hands-bot commentedon Sep 18, 2026
The following comments and acceptance criteria were added by the OpenHands AI agent.
Triage
Priority: high.
deepseek-v4.1-flashis the managed default Cloud model (#4941), andreasoning_effortis silently dropped on theopenhands/,litellm_proxy/, andopenai/routes — including the non-default levels (none,low,max) users explicitly configure. The silent drop misreports what was actually sent, and it also blocks #4934, which intends to remove the genericsupports_reasoningfallback that is currently the only thing keepingdeepseek-v4-flash/deepseek-v4-proworking onopenhands/routes.Scope: make
reasoning_effort(and an output cap) reach the wire for the bare DeepSeek V4 ids (deepseek-v4-flash,deepseek-v4-pro,deepseek-v4.1-flash) onopenhands/andlitellm_proxy/routes by resolving their parameter support via thedeepseek/provider — not via genericsupports_reasoning; honorcapability_overrides={"supports_reasoning_effort": True}onopenai/...routes that LiteLLM would otherwise drop; and log when a configuredreasoning_effortcannot be sent.Non-goals:
supports_reasoninggating as the enabler forreasoning_effort(keeps SDK sends unsupported reasoning_effort to MiniMax M3 #4934 composable).deepseek/provider translation ofreasoning_effortintothinkingis upstream LiteLLM; the SDK may either forward the level or document/link the upstream limitation, not reimplement LiteLLM's provider config.Acceptance criteria
openhands/deepseek-v4.1-flashsendsreasoning_effortwhen configured, with no proxy/v1/model/infometadata available (the issue'srepro_wire.pyprints'high'for this line).litellm_proxy/deepseek-v4.1-flashsendsreasoning_effortwhen configured, with no proxy metadata available (the repro prints'high'for this line).openhands/deepseek-v4-flashandopenhands/deepseek-v4-procontinue to sendreasoning_effortwithout depending on genericsupports_reasoningmetadata, so the change composes with SDK sends unsupported reasoning_effort to MiniMax M3 #4934.max_output_tokensis unset,openhands/deepseek-v4.1-flashresolves and sends a non-null output cap equal to the oneopenhands/deepseek-v4-flashresolves (16,384 per the issue) rather than omitting it.capability_overrides={"supports_reasoning_effort": True}, anopenai/openrouter/deepseek/deepseek-v4.1-flashrequest sendsreasoning_effort(the repro's last line prints'high'); anopenai/...model without the override still does not send it.reasoning_effortis still not sent when support is unknown or negative, with no regression of SDK sends unsupported reasoning_effort to MiniMax M3 #4934 / MiniMax M3.reasoning_effortthat cannot be sent on a given route emits a log line identifying that it was not forwarded (no silent discard).deepseek/provider either forwards the effort level (low/max) instead of discarding it, or an upstream LiteLLM issue documenting the limitation is linked in this issue/PR.openhands/,litellm_proxy/, andopenai/...with the override) plus the unknown/negative-support no-send case.[-][Bug]: reasoning_effort silently not sent for deepseek-v4.1-flash (openhands/, litellm_proxy/) and dropped on openai/ routes even with capability_overrides[/-][+][Bug]: DeepSeek V4.x reasoning_effort and output cap depend on proxy metadata (dropped without it, 384K default cap with it; openai/ ignores overrides)[/+]juanmichelini commentedon Sep 19, 2026
Notice that we have the opposite problem with minimal-m3 where reasoning effort is sent despite not being supported
[-][Bug]: DeepSeek V4.x reasoning_effort and output cap depend on proxy metadata (dropped without it, 384K default cap with it; openai/ ignores overrides)[/-][+][Bug]: output-cap defaults and explicit reasoning overrides are mishandled[/+]neubig commentedon Oct 5, 2026
I corrected the scope after maintainer review. The metadata-free reproducer did not establish that authenticated managed-proxy metadata is absent. The general proxy capability-contract question is now tracked in #5499; this issue is narrowed to the independently demonstrated output-cap default and explicit capability-override behaviors.
This comment was generated by an AI agent (OpenHands) on behalf of Graham Neubig.