Skip to content

✨ feat: add GLM-5.1 model and fix KimiCodingPlan issues#13700

Merged
arvinxx merged 6 commits into
lobehub:canaryfrom
hardy-one:fix/kimicodingplan-k25-fixes
Apr 10, 2026
Merged

✨ feat: add GLM-5.1 model and fix KimiCodingPlan issues#13700
arvinxx merged 6 commits into
lobehub:canaryfrom
hardy-one:fix/kimicodingplan-k25-fixes

Conversation

@hardy-one

@hardy-one hardy-one commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

πŸ’» Change Type

  • ✨ feat
  • πŸ› fix
  • ♻️ refactor
  • πŸ’„ style
  • πŸ‘· build
  • ⚑️ perf
  • βœ… test
  • πŸ“ docs
  • πŸ”¨ chore

πŸ”— Related Issue

πŸ”€ Description of Change

  1. feat(siliconcloud): add GLM-5.1 model support - Add GLM-5.1 (Pro) model with 198K context window, function call and reasoning capabilities, tiered pricing (0-32k / 32k+).

  2. fix: fix Kimi K2.5 model icon display - Change model id from 'k2p5' to 'kimi-k2.5' to match Moonshot icon keywords, while using deploymentName 'k2p5' for API calls.

  3. fix: normalize messages for KimiCodingPlan thinking models - Add message normalization for Kimi K2.5 and K2 Thinking models to fix "thinking is enabled but reasoning_content is missing" error when regenerating after using other providers.

πŸ§ͺ How to Test

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

πŸ“Έ Screenshots / Videos

Before After
... ...

πŸ“ Additional Information

- Change model id from 'k2p5' to 'kimi-k2.5' to match Moonshot icon keywords
- Add deploymentName 'k2p5' for API calls to use original model name
- Add KimiCodingPlan to providersWithDeploymentName list

This allows the model icon to display correctly while maintaining
backward compatibility with the API using the original 'k2p5' name.
Add message normalization for Kimi K2.5 and K2 Thinking models to ensure
every assistant message has a thinking block when thinking is enabled.

This fixes the issue where regenerating with KimiCodingPlan after using
other providers would fail with "thinking is enabled but reasoning_content
is missing" error, because historical messages from other providers don't
have reasoning fields.

The normalization adds a placeholder thinking block when:
1. Thinking is enabled for Kimi K2.5/K2 Thinking models
2. Assistant message doesn't have reasoning content
Add GLM-5.1 (Pro) model configuration with:
- 198K context window
- Function call and reasoning capabilities
- Tiered pricing (0-32k / 32k+)
- reasoningBudgetToken32k extension parameter
@vercel

vercel Bot commented Apr 9, 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.

@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.

We've reviewed this pull request using the Sourcery rules engine

@lobehubbot

Copy link
Copy Markdown
Member

@sxjeru - This PR adds GLM-5.1 model support for SiliconCloud and fixes KimiCodingPlan model provider issues (icon display and message normalization). Please take a look.

@codecov

codecov Bot commented Apr 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.36364% with 2 lines in your changes missing coverage. Please review.
βœ… Project coverage is 66.68%. Comparing base (1eb1fca) to head (ff26ed6).
⚠️ Report is 7 commits behind head on canary.

Additional details and impacted files
@@            Coverage Diff             @@
##           canary   #13700      +/-   ##
==========================================
+ Coverage   66.64%   66.68%   +0.03%     
==========================================
  Files        1998     1998              
  Lines      169037   169089      +52     
  Branches    16411    20421    +4010     
==========================================
+ Hits       112659   112754      +95     
+ Misses      56255    56212      -43     
  Partials      123      123              
Flag Coverage Ξ”
app 58.68% <100.00%> (+0.03%) ⬆️
database 92.58% <ΓΈ> (ΓΈ)
packages/agent-runtime 79.72% <ΓΈ> (ΓΈ)
packages/context-engine 83.33% <ΓΈ> (ΓΈ)
packages/conversation-flow 92.36% <ΓΈ> (ΓΈ)
packages/file-loaders 87.02% <ΓΈ> (ΓΈ)
packages/memory-user-memory 74.74% <ΓΈ> (ΓΈ)
packages/model-bank 99.85% <100.00%> (ΓΈ)
packages/model-runtime 84.62% <96.22%> (+0.03%) ⬆️
packages/prompts 69.69% <ΓΈ> (ΓΈ)
packages/python-interpreter 92.90% <ΓΈ> (ΓΈ)
packages/ssrf-safe-fetch 0.00% <ΓΈ> (ΓΈ)
packages/utils 90.14% <ΓΈ> (ΓΈ)
packages/web-crawler 88.66% <ΓΈ> (ΓΈ)

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

Components Coverage Ξ”
Store 66.77% <ΓΈ> (+0.13%) ⬆️
Services 52.23% <100.00%> (+<0.01%) ⬆️
Server 66.25% <ΓΈ> (+0.01%) ⬆️
Libs 52.82% <ΓΈ> (ΓΈ)
Utils 91.01% <ΓΈ> (ΓΈ)
πŸš€ 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.

@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: 4f0ad2e344

ℹ️ 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".

Comment thread src/services/chat/index.ts
Replace getModelPropertyWithFallback with a simple hardcoded mapping to fix
the issue where max_tokens lookup fails when using deploymentName (k2p5).

The model id is converted to deploymentName in ChatService layer before
reaching the provider, causing getModelPropertyWithFallback('k2p5', ...) to
fail since the model card uses id 'kimi-k2.5'.

By using a hardcoded mapping that supports both model id and deploymentName,
we avoid the lookup issue while keeping the code simple (KimiCodingPlan only
has a few models).
Add comprehensive tests for KimiCodingPlan provider covering:
- Hardcoded maxOutput mapping for k2p5, kimi-k2.5, kimi-k2-thinking
- Thinking parameter handling for kimi-k2.5 and kimi-k2-thinking models
- Message normalization with forceThinking for assistant messages
- Tool calls with reasoning content to prevent API error
Add comprehensive tests for KimiCodingPlan provider covering:
- Hardcoded maxOutput mapping for k2p5, kimi-k2.5, kimi-k2-thinking
- Thinking parameter handling for kimi-k2.5 and kimi-k2-thinking models
- Message normalization with forceThinking for assistant messages
- Tool calls with reasoning content to prevent API error
@arvinxx arvinxx merged commit 5f25efd into lobehub:canary Apr 10, 2026
22 of 25 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.

@skymkmk

skymkmk commented Apr 12, 2026

Copy link
Copy Markdown

Maybe we can update packages/model-bank/src/aiModels/zhipu.ts by the way.

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.

4 participants