Skip to content

fix(shared-adapter): 修正模型默认上下文容量 - #1068

Merged
dingyi222666 merged 1 commit into
ChatLunaLab:v1-devfrom
Procyon-Nan:fix/gemma4-context-size
Oct 24, 2026
Merged

dingyi222666 merged 1 commit into
ChatLunaLab:v1-devfrom
Procyon-Nan:fix/gemma4-context-size

Conversation

@Procyon-Nan

Copy link
Copy Markdown
Contributor

补充共享适配器的模型默认上下文容量,修正部分模型回退值不准确及匹配顺序问题。

  • Gemma 4:262,144,兼容 gemma4 和 gemma-4 命名。
  • Gemini 3/4、GLM-5.3、Kimi K3:1,048,576。
  • Qwen3.5–3.8 主要官方型号:1,000,000。
  • 将 Qwen2.5 规则置于 Qwen2 前,避免提前匹配为 32,000。
  • 删除冗余的 Gemini 2.0 Pro 条目。

更新 packages/shared-adapter/src/client.ts 中的上下文表,补充 Gemma 4、Gemini 3/4、GLM-5.3、Kimi K3 及 Qwen3.5–3.8 主要官方型号的默认容量。

调整 Qwen2.5 的匹配顺序,避免被 Qwen2 提前命中;删除可由通用规则覆盖的 Gemini 2.0 Pro 冗余条目。
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 77e45df0-279f-44c1-85c6-a2557d4754c9
Commits

Reviewing files that changed from the base of the PR and between 819b7f3 and d81563e.

Files selected for processing: 1
  • packages/shared-adapter/src/client.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Walkthrough

更新模型上下文长度表,新增 Gemini、Gemma、GLM、Kimi 和 Qwen 型号的映射,并调整部分 Gemini 条目。未匹配型号的回退值保持为 200,000。

Changes

模型上下文长度映射

Layer / File(s) Summary
更新模型上下文长度映射
packages/shared-adapter/src/client.ts
新增 Gemini 3/4、Gemma 4、GLM 5.3、Kimi K3 和多个 Qwen 3.5–3.8 型号的映射。调整 Gemini 3 的映射,并移除 Gemini 3.0 Pro、Gemini 3.1 Pro 和 Gemini 2.0 Pro 的单独条目。

Priority: Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: dingyi222666

Merge Risk: Minimal · up to d8156

The mapping changes are ready to merge with no identified correctness or availability risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed 标题明确说明了修正共享适配器模型默认上下文容量这一主要变更,且表述简洁。
Description check Passed 描述与变更内容一致,说明了模型上下文容量新增、匹配顺序调整和冗余条目删除。
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

小兔捧来新映射,
Gemini 名单添几行。
Qwen 型号排成队,
上下文值写得详。
耳朵一竖,代码香。

Comment @coderabbitai help to get the list of available commands.

@dingyi222666
dingyi222666 merged commit 7e0e035 into ChatLunaLab:v1-dev Oct 24, 2026
5 checks passed
@Procyon-Nan
Procyon-Nan deleted the fix/gemma4-context-size branch October 25, 2026 03:01
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.

2 participants