feat: refresh model list for API-key providers at the managed endpoint - #1824
Conversation
🦋 Changeset detectedLatest commit: dc6b81f 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 |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 268dd4450f
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba4cd73399
ℹ️ 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".
MoonshotAI#1824) * feat: refresh model list for API-key providers at the managed endpoint * docs: simplify changeset wording * docs: add kimi-code/k3 to the default config example * fix: clear stale default model when a refresh drops its alias * fix: clear refresh defaults via replace; set(undefined) cannot delete * docs: drop the auto model refresh paragraph from providers page * docs: simplify changeset wording
MoonshotAI#1824) * feat: refresh model list for API-key providers at the managed endpoint * docs: simplify changeset wording * docs: add kimi-code/k3 to the default config example * fix: clear stale default model when a refresh drops its alias * fix: clear refresh defaults via replace; set(undefined) cannot delete * docs: drop the auto model refresh paragraph from providers page * docs: simplify changeset wording
MoonshotAI#1824) * feat: refresh model list for API-key providers at the managed endpoint * docs: simplify changeset wording * docs: add kimi-code/k3 to the default config example * fix: clear stale default model when a refresh drops its alias * fix: clear refresh defaults via replace; set(undefined) cannot delete * docs: drop the auto model refresh paragraph from providers page * docs: simplify changeset wording
Related Issue
None — the problem is explained below.
Problem
Hand-configured
type = "kimi"providers that authenticate with a distributed API key against the Kimi Code managed endpoint never get their model list refreshed. Today only the OAuth login flow (managed:kimi-codewith an OAuth ref), the two open-platform providers (moonshot-cn/moonshot-ai), and api.json custom registries participate in the startup and periodic catalog refresh, so users running on distributed keys are stuck with a stale, hand-written model list — new models never appear, and removed models never go away.What changed
type: kimiproviders whosebase_urlmatches the managed Kimi Code endpoint exactly (parsed URL, lowercase origin, trailing slashes tolerated,KIMI_CODE_BASE_URLoverride respected). The credential is resolved the same way the runtime resolves it — inlineapi_keyfirst, thenKIMI_API_KEYfrom the provider'senvtable — and used as the Bearer token on{base_url}/models.services, and default selections are never rewritten, and aliases the user named outside the provider prefix are preserved. A hand-writtenmanaged:kimi-codewithout an OAuth ref is covered as well, sharing the OAuth branch'skimi-code/alias prefix so the two shapes merge cleanly if the user later logs in./modelsschema out of automatic refresh. Auth failures (expired/revoked key) are reported per provider without touching the config; an empty model list is a no-op.default_providerpointing at a refreshed provider is written back so the remove-then-set persistence sequence cannot silently drop it./modelsfetch now distinguishes API keys from OAuth credentials instead of always blaming "OAuth credentials".Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.