Repository navigation
fix(providers): read the Step model output limit from max_output_tokens - #374
Merged
Merged
Conversation
The Step catalog set maxTokens to the context window because /v1/models did not report an output limit, so the model picker showed the same value for context and output. Read max_output_tokens when the endpoint reports a positive value; models without it keep falling back to max_input_tokens.
ZouR-Ma
requested review from
MelodyVAR,
Uking-xxx and
liuedcson
as code owners
November 27, 2026 11:28
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.
Problem
The Step provider builds each model from
GET {base}/v1/models. That response only described the input window (max_input_tokens), sostepModelConfigcopied it intomaxTokens. Every Step model therefore reported the same value for context and output (for example1024K context · 1024K output), and requests sent an output budget equal to the remaining context.The endpoint now reports
max_output_tokensfor models that have a configured output limit.Changes
fetchStepModelsreadsmax_output_tokensfrom each catalog entry (positive numbers only) into the model'smaxTokens.maxTokenskeeps falling back to the context window, as before.Behavior and compatibility
max_output_tokensshow and request that limit; the model picker already rendersmodel.maxTokens, so no UI change is needed.Validation
pnpm exec vitest --run test/step-provider.test.ts(inpackages/coding-agent): the extended capability-mapping case failed before the change (maxTokens131072 instead of 8192) and passes after; 31/31 pass.pnpm run check: passes (also run by the pre-commit hook)../test.sh: all packages pass excepttest/subagent-invocation.test.tsin the full parallel run; it passes in isolation (4/4) both with and without this change, so it is unrelated load sensitivity.Limitations
The displayed output limit depends on the endpoint returning
max_output_tokens; until it does for a given model, that model keeps the previous fallback.