Conversation
Resolve bare OpenHands and LiteLLM proxy aliases through DeepSeek capability metadata, use a safe default output cap, and allow explicit reasoning overrides through OpenAI-compatible routes. Co-authored-by: openhands <openhands@all-hands.dev>
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.
HUMAN:
AGENT:
Why
DeepSeek V4 aliases routed through
openhands/orlitellm_proxy/losereasoning_effortwhen proxy metadata is unavailable. Proxy metadata can also advertise a 384K maximum that the SDK then sends as the default output cap, excluding lower-limit providers. Explicit capability overrides onopenai/...routes are also filtered by LiteLLM before reaching the wire.Summary
deepseek/capability metadata.allowed_openai_params, and log explicit reasoning settings that cannot be forwarded.Issue Number
Fixes #5181
How to Test
Setup and static checks:
All hooks passed, including Ruff, pycodestyle, Pyright, import boundaries, and tool registration.
Focused tests:
Result:
317 passed, 1 warning.I also ran the issue's fake OpenAI-compatible HTTP server repro with
reasoning_effort=low. The captured request bodies were:A full
uv run pytestwas also attempted. It reached the Agent Server suite, where ten unchanged WebSocket tests failed because this macOS environment routes localhost WebSockets through a SOCKS proxy without the optionalpython-sockspackage. The focused LLM suite and all pre-commit checks pass.Video/Screenshots
Not applicable; this is SDK request-routing behavior validated by captured HTTP request bodies.
Design Doc
Not applicable; the change extends the existing model-feature and output-cap paths.
Type
Notes
LiteLLM currently collapses native DeepSeek
low/maxreasoning levels to a boolean thinking switch. Upstream fixes are open in BerriAI/litellm#40717 and BerriAI/litellm#38736. This PR keeps that provider translation in LiteLLM, as scoped by #5181.