Skip to content

fix: preserve custom registry output caps#757

Closed
ktwu01 wants to merge 1 commit into
MoonshotAI:mainfrom
ktwu01:codex/custom-registry-output-limit
Closed

fix: preserve custom registry output caps#757
ktwu01 wants to merge 1 commit into
MoonshotAI:mainfrom
ktwu01:codex/custom-registry-output-limit

Conversation

@ktwu01

@ktwu01 ktwu01 commented Jun 14, 2026

Copy link
Copy Markdown

Related Issue

Resolve #509

Problem

Custom registry imports preserve model context limits but dropped provider-declared output limits. For OpenAI-compatible models with very large context windows, the completion budget could then use the context window as the request output cap, which can make providers reject the request with an invalid max_tokens error.

What changed

Custom registry model aliases now preserve valid limit.output values as maxOutputSize. Refresh coverage verifies output-limit metadata is carried forward while user-defined aliases remain untouched, and the OAuth unit test covers alias generation from rich registry metadata.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Validation:

  • pnpm vitest run packages/oauth/test/custom-registry.test.ts apps/kimi-code/test/tui/utils/refresh-providers.test.ts apps/kimi-code/test/cli/provider.test.ts
  • pnpm --filter @moonshot-ai/kimi-code-oauth typecheck
  • pnpm --filter @moonshot-ai/kimi-code typecheck
  • pnpm run lint

@changeset-bot

changeset-bot Bot commented Jun 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 83bf7af

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@moonshot-ai/kimi-code-oauth Patch
@moonshot-ai/kimi-code Patch

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

@liruifengv

liruifengv commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Thanks for contributing. This PR appears to be part of a batch generated by AI scanning the issue list, and we are not accepting this kind of bulk PR, so it is being closed.

@liruifengv liruifengv closed this Jun 15, 2026
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.

OpenCodeGo DeepSeek Pro model reports "Invalid max_tokens value"

2 participants