Skip to content

fix(providers): read the Step model output limit from max_output_tokens - #374

Merged
ZouR-Ma merged 1 commit into
mainfrom
fix/step-model-max-output-tokens
Nov 27, 2026
Merged

ZouR-Ma merged 1 commit into
mainfrom
fix/step-model-max-output-tokens

Conversation

@ZouR-Ma

@ZouR-Ma ZouR-Ma commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

Problem

The Step provider builds each model from GET {base}/v1/models. That response only described the input window (max_input_tokens), so stepModelConfig copied it into maxTokens. Every Step model therefore reported the same value for context and output (for example 1024K context · 1024K output), and requests sent an output budget equal to the remaining context.

The endpoint now reports max_output_tokens for models that have a configured output limit.

Changes

  • fetchStepModels reads max_output_tokens from each catalog entry (positive numbers only) into the model's maxTokens.
  • When the field is absent, maxTokens keeps falling back to the context window, as before.

Behavior and compatibility

  • Models whose catalog entry includes max_output_tokens show and request that limit; the model picker already renders model.maxTokens, so no UI change is needed.
  • Models without the field, and endpoints that do not return it yet, behave exactly as before.
  • No config, persisted data, or public interface changes.

Validation

  • pnpm exec vitest --run test/step-provider.test.ts (in packages/coding-agent): the extended capability-mapping case failed before the change (maxTokens 131072 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 except test/subagent-invocation.test.ts in 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.

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
ZouR-Ma merged commit 1d6bd6c into main Nov 27, 2026
2 checks passed
@ZouR-Ma
ZouR-Ma deleted the fix/step-model-max-output-tokens branch November 27, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant