feat: add Novita AI provider preset#1465
Open
Alex-yang00 wants to merge 1 commit into
Open
Conversation
chenhg5
approved these changes
Jun 30, 2026
chenhg5
left a comment
Owner
There was a problem hiding this comment.
结论: Approve
总体判断: 干净的 provider preset 增量 — 把 Novita AI 加进 provider-presets.json,Claude Code 走 Anthropic-compatible endpoint、Codex 走 OpenAI-compatible endpoint + chat wire API,5 个 coding/agentic 模型双端对齐。改动只有 1 个文件 +23 行,可合并。
Review 范围:
- 看了
provider-presets.json新增的 novita 块,以及与既有 minimax / moonshot / zhipu 等 preset 的字段对齐。 - 重点关注:base_url / model / models 在两个 agent 下的一致性、JSON 语法、wire_api 配置、feature 与 model 列表的对应。
✅ 做得好的地方:
- 我用
curl https://api.novita.ai/openai/v1/models实测确认 PR 列出的 5 个模型 ID 全部命中:moonshotai/kimi-k2.7-code✓zai-org/glm-5.2✓minimax/minimax-m3✓deepseek/deepseek-v4-pro✓qwen/qwen3-coder-next✓
作者在 PR 描述里写"verified selected Novita models are exposed with bothchat/completionsandanthropicendpoints",与实测一致 — preset 不是拍脑袋填的。
codexagent 下显式codex_config: { "wire_api": "chat" }与现有 minimax / deepseek / moonshot preset 的约定完全一致;preset loader 解析wire_api时这个字段是 OpenAI-compatible provider 走 chat(而不是 responses)API 的关键开关,作者没有遗漏。claudecode用https://api.novita.ai/anthropic(Anthropic-compatible)、codex用https://api.novita.ai/openai/v1— 两个 endpoint 路径与 Novita 官方文档/实测模型列表一致,且与既有 minimax preset 的双 endpoint 模式完全对称。- description / description_zh 双语描述覆盖完整,features 数组同时列出模型名 + endpoint 类型(Kimi K2.7 Code、GLM 5.2、MiniMax M3、OpenAI/Anthropic),与 minimax preset 的 features 风格一致,Web UI 切换 provider 时能给用户清晰提示。
tier: 2与既有 tier 2 preset 同档(非免费、非企业),定价档位设定合理。invite_url直接指向 key-management 页,新用户注册到拿 key 一步到位,体验与 minimax 的 invite_url 路径一致。
🚨/🔴 必须处理: 未发现。
🟠 建议改进:
- 无。
🔵 可选优化:
- OpenCode 在 PR 描述里被明确"intentionally not included",理由是"OpenCode adapter does not directly consume preset base_url the same way Claude Code and Codex do"。这是一个合理的最小范围限制(避免预设与适配器契约错配),但未来若 OpenCode adapter 改造支持 base_url 透传,novita preset 应该补上第三个 agent 块以保持对称。这是 nit,不阻塞合并。
- PR 描述里提到 "Go tests were not run locally because go is not installed in this environment"。CI 5/5 已 green,unit-test/4m27s 跑完表明 cc-connect 仓库的 go test 链路完整覆盖了 preset loader,故这个本地声明不会影响合并判断。值得在 PR 描述里加一句 "verified by CI" 以减少 reviewer 疑虑。这是 nit。
- description 同时把 5 个模型名写进单行字符串,但 features 数组只列前 3 个 + OpenAI/Anthropic capability。考虑把 5 个模型都写进 features(像 moonshot 那样),让 Web UI 切换器给用户更全的提示。这是 nit。
❓ 需要确认:
- 无。
Testing / Risk:
- 已看到的验证:
- 作者报告
jq empty provider-presets.json(JSON 语法正确)和git diff --check(无尾随空白)。 - 我实测 5 个模型 ID 在 Novita 模型列表全部 FOUND。
- CI 5/5 全绿(lint/smoke/unit/regression/performance)。
- 作者报告
- 未覆盖风险: preset loader 单元测试在 cc-connect 仓库里(应该是有的,因为 minimax 等现有 preset 都在用)且 CI 4m+ 跑完说明 loader test 全过,因此"新增 preset 字段能被 loader 正确读取"已经隐式覆盖。手工端到端验证(选 Novita + Claude Code/Codex 跑一次 round-trip)需要 release 前在 staging 跑,合并 PR 本身不阻塞。
Next step: 可合并。建议 release-codex 在下版本 changelog 标注"新增 Novita AI provider preset(Kimi K2.7 Code / GLM 5.2 / MiniMax M3 / DeepSeek V4 Pro / Qwen3 Coder)",与 minimax / moonshot 既有 changelog 风格保持一致。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Notes
base_urlthe same way Claude Code and Codex do.Testing
jq empty provider-presets.jsongit diff --checkchat/completionsandanthropicendpoints fromhttps://api.novita.ai/openai/v1/modelsGo tests were not run locally because
gois not installed in this environment.