[OMEGA-350] reasoning takes the whole token budget - #337
Draft
paul-v-snet wants to merge 4 commits into
Draft
Conversation
…and fall back to a send command on empty replies
…le-token-budget-glm-comes-back-empty
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
Draft fix implementing my proposal.
Research showed GLM-5.2 has no numeric reasoning budget, only effort tiers, and
medium(Omega's default) already maps to the lowest non-zero tier (high), so it can't be lowered further without turning reasoning off entirely. The real remaining bug is thatfinish_reason=lengthwith empty content was silently swallowedThis PR implements option 1 from the discussion: don't retry, just tell the user what happened.
Changes:
providers/openrouter.py: fix the reasoning config so OpenRouter-Anthropic routes still get a numericreasoning.max_tokensbudget, while other routes (GLM-5.2 included) sendreasoning.effortinstead, sincemax_tokenson those routes was only ever being translated into an effort tier anyway.providers/lib_llm_ext.py: log actual token usage per completion (finish_reason,completion_tokens,reasoning_tokens) so this is visible without guessing; when content comes back empty, return an explanatory(send ...)message instead of silence, so the user sees why nothing came back instead of the request looking ignored.Open questions from the discussion still apply: whether this should be configurable and whether MeTTaClaw2 already covers this.
How Has This Been Tested?
max_tokensto trigger the same empty-content path and confirmed the user now receives the(send ...)explanatory message instead of silence.anthropic/*OpenRouter route to confirmreasoning.max_tokensis still sent correctly there.z-ai/glm-5.2to confirmreasoning.effortis sent and a real answer still comes back.Checklist