feat(models): refresh preset provider catalog and model lists - #1781
Conversation
Align built-in provider presets with current provider offerings (referencing opencode's models.dev catalog): - Update preset model names to current generations (Claude 5 family, GLM-5.x, Kimi K3, Qwen 3.7, MiniMax M3, DeepSeek V4, Doubao Seed 2.1, Gemini 3.5/3.6) - Aggregate China/international endpoints and API/coding-plan endpoints under each provider via baseUrlOptions (Zhipu+Z.AI, DashScope+intl, MiniMax cn/io, Moonshot cn/ai + Kimi For Coding, SiliconFlow cn/com, Volcengine + BytePlus + coding plan, DeepSeek Anthropic endpoint) - Extend provider URL catalog for template inference from new endpoints - Localize new base URL option notes (zh-CN, zh-TW, en-US; installer synced) - Recognize Claude 5 family adaptive reasoning (web-ui gating and Anthropic adapter thinking capability for claude-fable) - Extend URL quirks to intl endpoints (dashscope-intl, siliconflow.com, api.z.ai tool_stream) - Update CLI provider selector presets
The sync-model-i18n script only writes en.json and zh.json; the new keys it introduced broke locale key parity with zh-TW.json in the i18n audit. Add the 14 missing keys, sourced from the web-ui zh-TW locale where available.
- Send Authorization: Bearer to Anthropic-compatible endpoints whose vendors document ANTHROPIC_AUTH_TOKEN auth: Z.AI, Moonshot /anthropic gateway, Kimi For Coding (previously only bigmodel.cn; the new Z.AI preset would have failed auth with x-api-key) - Drop kimi-for-coding from the shared Moonshot model list; it only exists on the api.kimi.com/coding endpoint and 404s on the default moonshot.cn API - Recognize dashscope-intl in the Qwen ASR base-url detection - Localize installer advancedShow/advancedHide (was hardcoded English in zh via the sync script) and refresh the stale glm placeholder
|
Applied review fixes in 9dc52a8:
Also fb33921 fixed the CI i18n audit failure (installer zh-TW key parity). |
…W installer i18n Second-pass review follow-ups: - The bearer-auth branch previously dropped the anthropic-version header for all bearer endpoints; keep sending it to Z.AI / Moonshot / Kimi gateways (Anthropic protocol requires it) while leaving bigmodel.cn's shipped behavior untouched - Tighten the Kimi match to api.kimi.com/coding - Teach sync-model-i18n.cjs to generate zh-TW.json (with zh-TW literals for installer-only strings) so installer locale parity cannot silently break again; re-synced zh-TW from the web-ui source of truth
|
Second review pass complete; follow-ups in e2baaf4:
Reviewer also verified migration safety for existing users: saved model configs (old model names, custom URLs) are untouched user data; provider grouping is independent of the expanded URL catalog; the catalog-based display-name migration only fills unnamed configs and strictly improves inferred names (e.g. |
The presets are duplicated across the web UI, the installer, the URL catalog and three locale bundles, and every drift between them has shipped either a request-time failure or an untranslated label. Assert the invariants instead of re-checking them by hand: catalog coverage both ways, note keys resolving to distinct labels in every locale, base URL shape matching what each adapter appends, and no URL owned by two providers. Verified by mutation: dropping a catalog URL, deleting a locale key and appending /v1 to an Anthropic base URL each fail a distinct assertion.
Third review pass (endpoint fact-check + Rust request tracing + frontend flow), all endpoints live-probed: - Note the Kimi For Coding model IDs on that base URL option; the plan serves k3 / kimi-for-coding, which are disjoint from the Moonshot API model list the provider block otherwise offers - Point the Moonshot and Anthropic help links at the hosts they now redirect to (platform.kimi.ai, platform.claude.com) - Normalize per-model reasoning drafts when the base URL dropdown changes the wire format, matching what the request-format dropdown already did; otherwise an adaptive mode or thinking budget could persist against a format that cannot express it - Installer: only a preset URL implies its format. A hand-typed proxy URL no longer snaps the format back to the template default, which would write an OpenAI config against an Anthropic-only endpoint - Installer: fall back to a note key's last segment instead of printing the whole dotted path when a translation is missing Cover the auth split with tests: Z.AI / Moonshot / Kimi document bearer tokens, while DeepSeek and MiniMax document x-api-key, so the two groups must not be unified. Also pin the Claude 5 thinking capabilities and assert vendor model names never take the Claude-specific paths.
|
Third review pass — three independent lenses (endpoint fact-check, Rust request-construction tracing, frontend flow + existing-user data). Fixes in 2789f19, plus a regression test in 4f079f9. Every endpoint was live-probed; no 404-class errors. Notably the Volcengine coding-plan path Fixed:
Deliberately not changed, since two reviewers disagreed and the evidence settles it: DeepSeek and MiniMax Also added Verification: web-ui 154 tests + tsc clean, installer tsc clean, |
…#1781) * feat(models): refresh preset provider catalog and model lists Align built-in provider presets with current provider offerings (referencing opencode's models.dev catalog): - Update preset model names to current generations (Claude 5 family, GLM-5.x, Kimi K3, Qwen 3.7, MiniMax M3, DeepSeek V4, Doubao Seed 2.1, Gemini 3.5/3.6) - Aggregate China/international endpoints and API/coding-plan endpoints under each provider via baseUrlOptions (Zhipu+Z.AI, DashScope+intl, MiniMax cn/io, Moonshot cn/ai + Kimi For Coding, SiliconFlow cn/com, Volcengine + BytePlus + coding plan, DeepSeek Anthropic endpoint) - Extend provider URL catalog for template inference from new endpoints - Localize new base URL option notes (zh-CN, zh-TW, en-US; installer synced) - Recognize Claude 5 family adaptive reasoning (web-ui gating and Anthropic adapter thinking capability for claude-fable) - Extend URL quirks to intl endpoints (dashscope-intl, siliconflow.com, api.z.ai tool_stream) - Update CLI provider selector presets * fix(i18n): backfill installer zh-TW keys added by model i18n sync The sync-model-i18n script only writes en.json and zh.json; the new keys it introduced broke locale key parity with zh-TW.json in the i18n audit. Add the 14 missing keys, sourced from the web-ui zh-TW locale where available. * fix(models): address review findings on new provider endpoints - Send Authorization: Bearer to Anthropic-compatible endpoints whose vendors document ANTHROPIC_AUTH_TOKEN auth: Z.AI, Moonshot /anthropic gateway, Kimi For Coding (previously only bigmodel.cn; the new Z.AI preset would have failed auth with x-api-key) - Drop kimi-for-coding from the shared Moonshot model list; it only exists on the api.kimi.com/coding endpoint and 404s on the default moonshot.cn API - Recognize dashscope-intl in the Qwen ASR base-url detection - Localize installer advancedShow/advancedHide (was hardcoded English in zh via the sync script) and refresh the stale glm placeholder * fix(models): keep anthropic-version on new bearer gateways; sync zh-TW installer i18n Second-pass review follow-ups: - The bearer-auth branch previously dropped the anthropic-version header for all bearer endpoints; keep sending it to Z.AI / Moonshot / Kimi gateways (Anthropic protocol requires it) while leaving bigmodel.cn's shipped behavior untouched - Tighten the Kimi match to api.kimi.com/coding - Teach sync-model-i18n.cjs to generate zh-TW.json (with zh-TW literals for installer-only strings) so installer locale parity cannot silently break again; re-synced zh-TW from the web-ui source of truth * test(models): lock provider preset invariants The presets are duplicated across the web UI, the installer, the URL catalog and three locale bundles, and every drift between them has shipped either a request-time failure or an untranslated label. Assert the invariants instead of re-checking them by hand: catalog coverage both ways, note keys resolving to distinct labels in every locale, base URL shape matching what each adapter appends, and no URL owned by two providers. Verified by mutation: dropping a catalog URL, deleting a locale key and appending /v1 to an Anthropic base URL each fail a distinct assertion. * fix(models): correct verified endpoint facts and format-switch handling Third review pass (endpoint fact-check + Rust request tracing + frontend flow), all endpoints live-probed: - Note the Kimi For Coding model IDs on that base URL option; the plan serves k3 / kimi-for-coding, which are disjoint from the Moonshot API model list the provider block otherwise offers - Point the Moonshot and Anthropic help links at the hosts they now redirect to (platform.kimi.ai, platform.claude.com) - Normalize per-model reasoning drafts when the base URL dropdown changes the wire format, matching what the request-format dropdown already did; otherwise an adaptive mode or thinking budget could persist against a format that cannot express it - Installer: only a preset URL implies its format. A hand-typed proxy URL no longer snaps the format back to the template default, which would write an OpenAI config against an Anthropic-only endpoint - Installer: fall back to a note key's last segment instead of printing the whole dotted path when a translation is missing Cover the auth split with tests: Z.AI / Moonshot / Kimi document bearer tokens, while DeepSeek and MiniMax document x-api-key, so the two groups must not be unified. Also pin the Claude 5 thinking capabilities and assert vendor model names never take the Claude-specific paths. * style(models): rustfmt the new anthropic request tests --------- Co-authored-by: bowen628 <bowen628@noreply.gitcode.com>
Summary
Aligns the built-in AI provider presets with providers' current offerings, using opencode's data source (models.dev) as the reference catalog.
Model list updates
Endpoint aggregation (国内/海外 + API/Coding Plan)
Each provider now aggregates its regional and plan-specific endpoints under one template via
baseUrlOptions:Supporting changes
providerCatalog.ts: URL catalog extended so template inference recognizes the new endpointssync-model-i18n.cjsclaude-fablemapped to the same thinking capability asclaude-mythosin the Anthropic adapter (effort-only, no budget_tokens)enable_thinkingnow also applies to dashscope-intl / siliconflow.com;tool_streamalso applies to api.z.aiTesting
vitest run src/infrastructure/config— 150 tests passtsc --noEmit(web-ui) — cleancargo test -p bitfun-ai-adapters— 151+ tests passcargo check -p bitfun-cli— clean