fix: explicit max_completion_tokens on OpenRouter chat calls - #172
Merged
Conversation
fazpu
enabled auto-merge (squash)
July 29, 2026 12:29
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
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.
Urgent production fix from the GLM-5.2 smoke: the adapter sent no
max_tokens, so reasoning models burned the provider's default completion cap on reasoning — observedfinish_reason='length',content=null,reasoning_present=True, and mid-string-truncated JSON (constant-length non-JSON content) dead-lettering E2 on hard chunks.OpenRouterSettings.max_completion_tokens(envREMEMBERSTACK_OPENROUTER_MAX_COMPLETION_TOKENS, default 32000, empty string = default,Noneomits the key) now rides every chat payload asmax_tokens; forwarded in compose, documented in.env.example, exposed in readiness bindings, and recorded as a dated §2.4 observation. Provider account caps remain the monetary boundary.Review: Grok APPROVE (4 NITs, none blocking — noted for follow-up: a third positive-override param case, the deprecated wire-key name, no env spelling for omit). Final review by Claude. Fast gate local; the full matrix is CI's.