Skip to content

feat(oauth): parse support_efforts/default_effort in custom registry import - #1564

Merged
sailist merged 3 commits into
MoonshotAI:mainfrom
sailist:feat/custom-registry-efforts
Jul 12, 2026
Merged

feat(oauth): parse support_efforts/default_effort in custom registry import#1564
sailist merged 3 commits into
MoonshotAI:mainfrom
sailist:feat/custom-registry-efforts

Conversation

@sailist

@sailist sailist commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue — the problem is explained below.

Problem

When adding a platform via a custom registry (api.json), model entries declaring support_efforts / default_effort had those fields silently dropped: the parser only recognized tool_call, reasoning, modalities, and limit. As a result, models imported this way never exposed thinking effort levels, even though the same fields are already honored for managed Kimi Code and open-platform imports.

What changed

  • Parse support_efforts (string array) and default_effort (non-empty string) from api.json model entries in the custom-registry import path; invalid values are ignored, matching the existing lenient handling of other optional fields.
  • Map them onto the generated model aliases as supportEfforts / defaultEffort — the same camelCase keys the managed and open-platform flows write, so the existing thinking-effort selection works without downstream changes.
  • Add both keys to CUSTOM_REGISTRY_MODEL_FIELDS, making them upstream-owned: refreshes sync declared values, and stale values are dropped when upstream stops declaring them (same semantics as the managed flow).
  • Tests: parsing from api.json, alias mapping, refresh overwrite / drop behavior in custom-registry.test.ts and model-alias-merge.test.ts.

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.

sailist added 2 commits July 12, 2026 12:02
…import

- parse support_efforts / default_effort from api.json model entries
- map them onto model aliases as supportEfforts / defaultEffort
- treat both fields as upstream-owned in CUSTOM_REGISTRY_MODEL_FIELDS so
  refreshes sync and stale values are dropped
@changeset-bot

changeset-bot Bot commented Jul 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 52340bc

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

This PR includes changesets to release 1 package
Name Type
@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

@pkg-pr-new

pkg-pr-new Bot commented Jul 12, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@52340bc
npx https://pkg.pr.new/@moonshot-ai/kimi-code@52340bc

commit: 52340bc

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 03faaeefee

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

maxContextSize,
capabilities,
displayName,
...(model.support_efforts !== undefined ? { supportEfforts: model.support_efforts } : {}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mark effort-only registry models as thinking-capable

When a registry model supplies support_efforts/default_effort but does not also set reasoning: true, this stores the effort levels while capabilities remains resolved without thinking because resolveCapabilities only considers the reasoning flag. Downstream thinking defaults check capabilities first, so these imported models are treated as unsupported/off despite advertising concrete efforts. Add the thinking capability when accepted support_efforts is non-empty, or ignore the effort fields unless reasoning is true.

Useful? React with 👍 / 👎.

Models declaring effort levels without reasoning: true now get the
thinking capability, so their efforts are not silently ignored.
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