Skip to content

fix(adapter-deepseek): set discovered context window#915

Merged
dingyi222666 merged 1 commit into
v1-devfrom
fix/ds-context-window
Jun 10, 2026
Merged

fix(adapter-deepseek): set discovered context window#915
dingyi222666 merged 1 commit into
v1-devfrom
fix/ds-context-window

Conversation

@dingyi222666

Copy link
Copy Markdown
Member

This pr fixes DeepSeek model metadata for models returned by the provider API.

Bug fixes

  • Set the discovered DeepSeek model context window to 1,000,000 tokens.

Other Changes

  • Bump koishi-plugin-chatluna-deepseek-adapter to 1.4.0-alpha.9.

Validation

  • yarn lint-fix (0 errors, existing max-len warnings only)

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ef06aac5-fa73-461f-a9cb-63bf53a1fd38

📥 Commits

Reviewing files that changed from the base of the PR and between 4ace648 and 31ca638.

⛔ Files ignored due to path filters (1)
  • packages/adapter-deepseek/package.json is excluded by !**/*.json
📒 Files selected for processing (1)
  • packages/adapter-deepseek/src/client.ts

概览

该 PR 在 DeepSeek 适配器的客户端中为模型刷新方法补充了显式的最大令牌上限配置,将 maxTokens 字段设置为 1_000_000

变更内容

DeepSeek 模型最大令牌配置

层 / 文件 摘要
ModelInfo 最大令牌字段补充
packages/adapter-deepseek/src/client.ts
refreshModels() 方法返回的 ModelInfo 对象中新增 maxTokens: 1_000_000 字段,显式指定 DeepSeek 模型的最大令牌限制。

估计代码审查工作量

🎯 1 (极简) | ⏱️ ~2 分钟

可能相关的 PR

  • ChatLunaLab/chatluna#905:同样修改 packages/adapter-deepseek/src/client.ts 中的 refreshModels() 方法以设置 DeepSeek 最大令牌限制。

🐰 一只小兔在代码森林里,
为 DeepSeek 模型添上令牌的翅膀,
一百万的上限闪闪发光,
让对话流畅如丝线轻扬。
简单的改动,大大的智慧!✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR标题清晰准确地总结了主要变更:为DeepSeek适配器的已发现模型设置上下文窗口大小。
Description check ✅ Passed PR描述与代码变更高度相关,清楚地说明了修复内容(设置DeepSeek模型上下文为1,000,000 tokens)及其他关联变更。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ds-context-window

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

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

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request bumps the version of the DeepSeek adapter and introduces a hardcoded maxTokens limit of 1,000,000. However, this limit is too high and inaccurate for DeepSeek models, which support 128,000 tokens for LLMs and 8,192 tokens for embeddings. It is recommended to set the maxTokens conditionally based on the model type to avoid API errors and context overflow.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/adapter-deepseek/src/client.ts
@dingyi222666 dingyi222666 merged commit abe32e9 into v1-dev Jun 10, 2026
4 of 5 checks passed
@dingyi222666 dingyi222666 deleted the fix/ds-context-window branch June 10, 2026 19:38
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.

1 participant