Repository navigation
fix(oauth): record max_output_size from custom-registry model limits - #3733
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 0f48e45 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Custom-registry (api.json) imports and refreshes wrote only max_context_size into model aliases, dropping limit.output even when the registry advertises it. With no max_output_size on the alias, the completion budget falls back to the full context window, so providers that validate the output-token cap (e.g. an openai_responses gateway with a 393216 ceiling) reject the request with '400 Invalid max_tokens value'.
sailist
approved these changes
Oct 29, 2026
5 of 6 tasks
This was referenced Oct 31, 2026
Closed
7723qqq
pushed a commit
to 7723qqq/kimi-code
that referenced
this pull request
Nov 4, 2026
The behaviour of MoonshotAI#4421 has been in the requester since 94397aa, but its suite still asserted only that the lowered system message lost its `tools` field, which a message kept in place would also satisfy. Assert instead that no system message survives and the history keeps its length, and rename the case after what it protects. Also settle ten ledger rows that were already implemented here: MoonshotAI#3733, MoonshotAI#4413, MoonshotAI#4418, MoonshotAI#4421, MoonshotAI#4435, MoonshotAI#4460, MoonshotAI#4465, MoonshotAI#4516, MoonshotAI#4523, MoonshotAI#4532 and the MoonshotAI#4558 test calibration, each with a probe over the suite that pins it. Two rows carried a probe without a test-name selector (MoonshotAI#4557, MoonshotAI#4558), which aborted `--verify` for every other row; MoonshotAI#4557 is a changelog sync and now carries a manual probe.
This was referenced Nov 5, 2026
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.
Related Issue
Resolve #3732
Problem
See linked issue. In short: models imported from a custom registry (
api.json) ignore the advertisedlimit.output, so the alias never recordsmaxOutputSize. The completion-budget cap then falls back to the model's full context size and goes out as the protocol's output-token field (max_output_tokensforopenai_responses,max_completion_tokens/max_tokensforopenai,max_tokensforanthropic— which additionally falls back to a 128k provider default). Any registry model with a smaller real output cap rejects the request with a 400 (e.g. "Invalid max_output_tokens").What changed
packages/oauth/src/custom-registry.ts: readlimit.output(validated as a positive integer) from each registry model entry into the aliasmaxOutputSize— mirroring howlimit.context→maxContextSizeis already handled, and matching the existing models.dev integration's convention for the same field.packages/oauth/src/model-alias-merge.ts: addmaxOutputSizetoCUSTOM_REGISTRY_MODEL_FIELDSso registry refreshes keep the field in sync — new values applied, stale values dropped when the registry stops declaring it, useroverridespreserved.limit.output→maxOutputSizemapping and the stale-drop-on-refresh case.@moonshot-ai/kimi-code, patch).Checklist
/approveon the issue per policy).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update. (No doc update needed: the docs do not document registrylimitfields, and this change makes behavior match the data registries already advertise.)