Repository navigation
Conversation
The base AIProvider.convert_request in providers/lib_llm_ext.py ignored
request.reasoning_mode, so the OpenAIAPI provider sent no reasoning hint
to OpenAI-compatible backends (llama.cpp server, vLLM, Strata, ...).
Thinking-capable models then ran at the server's default thinking level
and could exhaust the shared output budget, producing finish_reason=length
with empty content and the misleading "reasoning exceeded the token limit"
reply, which advises lowering a setting that had no effect.
Forward the mode as extra_body.reasoning_effort, the parameter these
servers accept ("none" disables thinking). Plain OpenAI chat-completions
endpoints ignore unknown fields. The OpenAI, OpenRouter and ASIonE
providers already map the mode themselves and are unaffected:
OpenRouter merges the base extra_body with its own reasoning object,
ASIonE replaces it with its thinking budget as before.
Adds unit tests for the base provider (forward medium/none, omit when
reasoning_mode is unset).
Fixes singnet#402
This branch has not been deployed
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.
Description
Fixes #402.
The base
AIProvider.convert_requestinproviders/lib_llm_ext.pybuilt the request body frommodel,messages,max_tokens,toolsandtool_choiceonly, silently droppingrequest.reasoning_mode. As a result, theOpenAIAPIprovider (and any provider delegating to the base implementation) sent no reasoning hint to OpenAI-compatible backends such as llama.cpp server, vLLM, or Strata.Thinking-capable models then ran at the backend's default thinking level. Thinking tokens share the output budget, so long thinking chains exhaust it:
finish_reason=lengthwith empty content, and the user sees the "reasoning exceeded the token limit" message - which advises loweringreasoningMode, a setting that had no effect on this provider.The fix forwards the mode as
extra_body.reasoning_effort, the parameter these servers accept ("none"disables thinking). Plain OpenAI chat-completions endpoints ignore unknown fields, so existing users are unaffected. TheOpenAI,OpenRouterandASIonEproviders already map the mode themselves:extra_bodywith its ownreasoningobject (both keys are consistent);extra_bodywith its thinking budget exactly as before.Three unit tests are added for the base provider: forwarding
mediumandnone, and omittingextra_bodyentirely whenreasoning_modeis unset.How Has This Been Tested?
main@fccc74dwith the patch applied:pytest Autotests/unit-> 145 passed (142 pre-existing + 3 new).extra_body={"reasoning_effort": ...}) has been running in a production Omega v0.1.20 deployment (Docker,OpenAIAPIprovider against a local llama.cpp/Strata proxy) since 2026-10-14, where it resolved the empty-response failures described in [OMEGA-522] OpenAIAPI provider drops reasoningMode from the request body (base AIProvider.convert_request ignores request.reasoning_mode) #402.Checklist