Skip to content

✨ feat: add Coding Plan providers support#13203

Merged
arvinxx merged 18 commits into
lobehub:canaryfrom
hardy-one:feat/coding-plan-providers
Mar 25, 2026
Merged

✨ feat: add Coding Plan providers support#13203
arvinxx merged 18 commits into
lobehub:canaryfrom
hardy-one:feat/coding-plan-providers

Conversation

@hardy-one

@hardy-one hardy-one commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

💻 Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • ✅ test
  • 📝 docs
  • 🔨 chore

🔗 Related Issue

🔀 Description of Change

本PR为LobeHub添加了5个Coding Plan providers支持:BailianCodingPlan、GLMCodingPlan、KimiCodingPlan、MiniMaxCodingPlan、VolcengineCodingPlan。
为什么Coding Plan需要单独的provider,而不是复用普通provider?
Coding Plan需要独立provider的主要理由如下:

  1. 独立的API端点和计费体系:Coding Plan使用专门的API端点(如coding.dashscope.aliyuncs.com/v1),而非通用endpoint。每个Coding Plan有独立的计费方式和配额管理。
  2. 特殊的模型配置和参数:Coding Plan包含特定的模型集合,这些模型可能不在通用provider的模型列表中,而普通api端点支持的模型,也可能不在Coding Plan中提供,需要独立维护。
  3. 不同的功能特性和优化方向:Coding Plan专注于编程任务优化,与通用chat模型有明显区别,例如大部分Coding Plan应该不支持模型内置搜索。

修改概述:

  1. 新增Coding Plan Providers
  • 为每个coding plan创建独立的provider配置(packages/model-bank/src/modelProviders/)
  • 添加对应的模型定义(packages/model-bank/src/aiModels/)
  • 实现运行时处理逻辑(packages/model-runtime/src/providers/)
  • 添加测试用例(index.test.ts)
  1. 特殊参数支持
  • 新增ReasoningTokenSlider32k和ReasoningTokenSlider80k组件,支持32k/80k两种reasoning token范围
  • 更新ControlsForm组件,集成新的滑块组件
  • 扩展chatConfig类型定义,支持新的extendParams
  1. UI集成
  • 更新ProviderGrid/Card组件,添加Coding Plan标签
  • 修改ExtendParamsSelect组件,支持coding plan参数
  • 更新modelParamsResolver,处理coding plan特殊参数
  1. 国际化支持
  • 更新locales/en-US/models.json和providers.json
  • 在src/locales/default/modelProvider.ts中添加i18n键
  1. 运行时集成
  • 在runtimeMap.ts中注册所有新的coding plan providers
  • 配置专门的API端点和SDK类型

🧪 How to Test

  • Tested locally
  • Added/updated tests
  • No tests needed

📸 Screenshots / Videos

Before After
... image
... image
... image

📝 Additional Information

Related to: lobehub/lobe-icons#272

@vercel

vercel Bot commented Mar 23, 2026

Copy link
Copy Markdown

@hardy-one is attempting to deploy a commit to the LobeHub OSS Team on Vercel.

A member of the Team first needs to authorize it.

@lobehubbot

Copy link
Copy Markdown
Member

Hi @arvinxx @tjx666 👋

Could you review this PR? It adds Coding Plan providers support (BailianCodingPlan, GLMCodingPlan, KimiCodingPlan, MiniMaxCodingPlan, VolcengineCodingPlan) with changes across:

  • packages/model-bank/ – new model definitions and provider configs
  • packages/model-runtime/ – new provider implementations with tests
  • src/features/ModelSwitchPanel/ – new ReasoningTokenSlider32k/80k components
  • src/services/chat/ – modelParamsResolver updates
  • locales/ – i18n updates

@codecov

codecov Bot commented Mar 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.08219% with 80 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.22%. Comparing base (6a45414) to head (8bc60ed).
⚠️ Report is 22 commits behind head on canary.

❗ There is a different number of reports uploaded between BASE (6a45414) and HEAD (8bc60ed). Click for more details.

HEAD has 13 uploads less than BASE
Flag BASE (6a45414) HEAD (8bc60ed)
packages/file-loaders 2 1
packages/prompts 2 1
packages/model-runtime 2 1
packages/web-crawler 2 1
packages/utils 2 1
packages/python-interpreter 2 1
packages/context-engine 2 1
packages/agent-runtime 2 1
packages/conversation-flow 2 1
database 2 1
packages/ssrf-safe-fetch 2 1
packages/model-bank 2 1
packages/memory-user-memory 2 1
Additional details and impacted files
@@             Coverage Diff             @@
##           canary   #13203       +/-   ##
===========================================
- Coverage   87.37%   74.22%   -13.15%     
===========================================
  Files         578     1549      +971     
  Lines       44014   126977    +82963     
  Branches     6852    14628     +7776     
===========================================
+ Hits        38456    94254    +55798     
- Misses       5447    32612    +27165     
  Partials      111      111               
Flag Coverage Δ
app 67.19% <47.36%> (?)
database 97.89% <ø> (ø)
packages/agent-runtime 89.60% <ø> (ø)
packages/context-engine 83.57% <ø> (+0.03%) ⬆️
packages/conversation-flow 92.36% <ø> (ø)
packages/file-loaders 87.02% <ø> (ø)
packages/memory-user-memory 66.68% <ø> (ø)
packages/model-bank 99.85% <100.00%> (+0.01%) ⬆️
packages/model-runtime 84.53% <65.17%> (-0.26%) ⬇️
packages/prompts 74.60% <ø> (ø)
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/utils 90.34% <ø> (+0.24%) ⬆️
packages/web-crawler 88.82% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 66.10% <ø> (∅)
Services 49.70% <47.36%> (∅)
Server 68.63% <31.57%> (∅)
Libs 42.63% <ø> (∅)
Utils 91.41% <ø> (-2.07%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hardy-one hardy-one marked this pull request as ready for review March 23, 2026 12:23

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @hardy-one, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@vercel

vercel Bot commented Mar 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lobehub Ready Ready Preview, Comment Mar 23, 2026 4:59pm

Request Review

- Add new AI provider for Bailian Coding Plan (coding.dashscope.aliyuncs.com/v1)
- Support 8 coding-optimized models: Qwen3.5 Plus, Qwen3 Coder Plus/Next, Qwen3 Max, GLM-5/4.7, Kimi K2.5, MiniMax M2.5
- Reuse QwenAIStream for stream processing
- Static model list (Coding Plan does not support API model fetching)
- Add i18n translations for provider description
- Add new AI provider for MiniMax Token Plan (api.minimax.io/v1)
- Support 6 models: MiniMax-M2.7, M2.7-highspeed, M2.5, M2.5-highspeed, M2.1, M2
- Static model list (Coding Plan does not support API model fetching)
- Add i18n translations for provider description
- Add new AI provider for GLM Coding Plan (api.z.ai/api/paas/v4)
- Support 6 models: GLM-5, GLM-5-Turbo, GLM-4.7, GLM-4.6, GLM-4.5, GLM-4.5-Air
- Static model list (Coding Plan does not support API model fetching)
- Add i18n translations for provider description
- Add new AI provider for Kimi Code Plan (api.moonshot.ai/v1)
- Support 3 models: Kimi K2.5, Kimi K2, Kimi K2 Thinking
- Static model list (Coding Plan does not support API model fetching)
- Add i18n translations for provider description
- Add new AI provider for Volcengine Coding Plan (ark.cn-beijing.volces.com/api/coding/v3)
- Support 5 models: Doubao-Seed-Code, Doubao-Seed-Code-2.0, GLM-4.7, DeepSeek-V3.2, Kimi-K2.5
- Static model list (Coding Plan does not support API model fetching)
- Add i18n translations for provider description
…r variants

- Add ReasoningTokenSlider32k component (max 32*1024)
- Add ReasoningTokenSlider80k component (max 80*1024)
- Add reasoningBudgetToken32k and reasoningBudgetToken80k to ExtendParamsType
- Update ControlsForm to render appropriate slider based on extendParams
- Update ExtendParamsSelect with new options and previews
- Fix ReasoningTokenSlider max value to use 64*Kibi (65536) instead of 64000
…aramsResolver

- Add reasoningBudgetToken32k and reasoningBudgetToken80k fields to chatConfig type and schema
- Update ControlsForm to use correct name matching for 32k/80k sliders
- Add processing logic for 32k/80k params in modelParamsResolver
- Add i18n translations for extendParams hints
- Switch from log2 scale to linear scale for equal mark spacing
- Add minWidth/maxWidth constraints to limit slider length
- Fix 64k and 80k marks being too close together
- Slider uses index [0,1,2,3,...] for equal mark spacing
- Map index to token values via MARK_TOKENS array
- Add minWidth/maxWidth to limit slider length when marks increase
- minimaxCodingPlan: change API URL to api.minimaxi.com (China site)
- kimiCodingPlan: change API URL to api.kimi.com/coding/v1
- volcengineCodingPlan: update doubao-seed models with correct deploymentName, pricing
- volcengineCodingPlan: add minimax-m2.5 model
- bailianCodingPlan & volcengineCodingPlan: remove unsupported extendParams from minimax-m2.5
- Coding Plan does not support fetching model list via API
- Set both modelList.showModelFetcher and settings.showModelFetcher to false
@hardy-one hardy-one force-pushed the feat/coding-plan-providers branch from 265abb5 to 2f31287 Compare March 24, 2026 03:24
… read when enableReasoning is present

- Add nested logic to check which budget field (32k/80k/generic) the model supports when enableReasoning is true
- Move reasoningBudgetToken32k/80k else-if branches before reasoningBudgetToken to ensure correct field is read
- Fix GLM-5/GLM-4.7 models sending wrong budget_tokens value to API
@arvinxx arvinxx merged commit ad2087c into lobehub:canary Mar 25, 2026
20 of 21 checks passed
@lobehubbot

Copy link
Copy Markdown
Member

❤️ Great PR @hardy-one ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.

ONLY-yours added a commit that referenced this pull request Mar 27, 2026
# 🚀 release: 20260326

This release includes **91 commits**. Key updates are below.


- **Agent can now execute background tasks** — Agents can perform
long-running operations without blocking your conversation.
[#13289](#13289)
- **Better error messages** — Redesigned error UI across chat and image
generation with clearer explanations and recovery options.
[#13302](#13302)
- **Smoother topic switching** — No more full page reloads when
switching topics while an agent is responding.
[#13309](#13309)
- **Faster image uploads** — Large images are now automatically
compressed to 1920px before upload, reducing wait times.
[#13224](#13224)
- **Improved knowledge base** — Documents are now properly parsed before
chunking, improving retrieval accuracy.
[#13221](#13221)

### Bot Platform

- **WeChat Bot support** — You can now connect LobeChat to WeChat, in
addition to Discord.
[#13191](#13191)
- **Richer bot responses** — Bots now support custom markdown rendering
and context injection.
[#13294](#13294)
- **New bot commands** — Added `/new` to start fresh conversations and
`/stop` to halt generation.
[#13194](#13194)
- **Discord stability fixes** — Fixed thread creation issues and Redis
connection drops.
[#13228](#13228)
[#13205](#13205)

### Models & Providers

- **GLM-5** is now available in the LobeHub model list.
[#13189](#13189)
- **Coding Plan providers** — Added support for code planning assistant
providers. [#13203](#13203)
- **Tencent Hunyuan 3.0 ImageGen** — New image generation model from
Tencent. [#13166](#13166)
- **Gemini content handling** — Better handling when Gemini blocks
content due to safety filters.
[#13270](#13270)
- **Claude token limits fixed** — Corrected max window tokens for
Anthropic Claude models.
[#13206](#13206)

### Skills & Tools

- **Auto credential injection** — Skills can now automatically request
and use required credentials.
[#13124](#13124)
- **Smarter tool permissions** — Built-in tools skip confirmation for
safe paths like `/tmp`.
[#13232](#13232)
- **Model switcher improvements** — Quick access to provider settings
and visual highlight for default model.
[#13220](#13220)

### Memory

- **Bulk delete memories** — You can now delete all memory entries at
once. [#13161](#13161)
- **Per-agent memory control** — Memory injection now respects
individual agent settings.
[#13265](#13265)

### Desktop App

- **Gateway connection** — Desktop app can now connect to LobeHub
Gateway for enhanced features.
[#13234](#13234)
- **Connection status indicator** — See gateway connection status in the
titlebar. [#13260](#13260)
- **Settings persistence** — Gateway toggle state now persists across
app restarts. [#13300](#13300)

### CLI

- **API key authentication** — CLI now supports API key auth for
programmatic access.
[#13190](#13190)
- **Shell completion** — Tab completion for bash/zsh/fish shells.
[#13164](#13164)
- **Man pages** — Built-in manual pages for CLI commands.
[#13200](#13200)

### Security

- **XSS protection** — Sanitized search result image titles to prevent
script injection.
[#13303](#13303)
- **Workflow hardening** — Fixed potential shell injection in release
automation. [#13319](#13319)
- **Dependency update** — Updated nodemailer to address security
advisory. [#13326](#13326)

### Bug Fixes

- Fixed skill page not redirecting correctly after import.
[#13255](#13255)
[#13261](#13261)
- Fixed token counting in group chats.
[#13247](#13247)
- Fixed editor not resetting when switching to empty pages.
[#13229](#13229)
- Fixed manual tool toggle not working.
[#13218](#13218)
- Fixed Search1API response parsing.
[#13207](#13207)
[#13208](#13208)
- Fixed mobile topic menus rendering issues.
[#12477](#12477)
- Fixed history count calculation for accurate context.
[#13051](#13051)
- Added missing Turkish translations.
[#13196](#13196)

### Credits

Huge thanks to these contributors:

@bakiburakogun @hardy-one @Zhouguanyang @sxjeru @hezhijie0327 @arvinxx
@cy948 @CanisMinor @Innei @lijian @lobehubbot @neko @rdmclin2
@rivertwilight @tjx666
hardy-one added a commit to hardy-one/lobehub that referenced this pull request Apr 23, 2026
Add zod schema and runtimeEnv mappings for BailianCodingPlan,
GLMCodingPlan, MinimaxCodingPlan, and VolcengineCodingPlan in llm.ts.
These were missing when the providers were added in lobehub#13203, causing
them to fall back to OPENAI_API_KEY instead of their own env vars.
arvinxx pushed a commit that referenced this pull request Apr 23, 2026
…4064)

* 🐛 fix: add env var support for missing Coding Plan providers

Add zod schema and runtimeEnv mappings for BailianCodingPlan,
GLMCodingPlan, MinimaxCodingPlan, and VolcengineCodingPlan in llm.ts.
These were missing when the providers were added in #13203, causing
them to fall back to OPENAI_API_KEY instead of their own env vars.

* 🐛 fix: add env var support for OpenCode Zen and OpenCode CodingPlan providers

Add zod schema and runtimeEnv mappings in llm.ts for OpenCodeZen and
OpenCodeCodingPlan providers introduced in #13943. Without these,
getParamsFromPayload falls back to OPENAI_API_KEY.
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.

3 participants