Bug: The Tongyi plugin incorrectly reports/enforces DeepSeek-R1 context window as 64K, while the official spec is 131,072 #929

Closed
opened 2026-02-16 10:21:02 -05:00 by yindo · 1 comment
Owner

Originally created by @hsiong on GitHub (Jan 11, 2026).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.11.2

Plugin version

langgenius/tongyi 0.1.18

Cloud or Self Hosted

Cloud

Steps to reproduce

  1. Install Tongyi plugin v0.1.18 from Dify Marketplace.
  2. Configure an LLM using DeepSeek-R1 in the Tongyi plugin.
  3. Select CHAT mode.
  4. Observe the model context length shown in Dify UI or enforced by the plugin.
  5. Compare the configured / displayed context window with the official DeepSeek-R1 specification.

✔️ Error log

No explicit runtime error.
This is a configuration / capability mismatch issue.

Bug: The Tongyi plugin incorrectly reports/enforces DeepSeek-R1 context window as 64K, while the official spec is 131,072. This blocks long-context chats and truncates inputs earlier than expected.

Image

The model details shown in the Tongyi/Dify UI on the Aliyun Bailian console also list DeepSeek-R1

Image
Originally created by @hsiong on GitHub (Jan 11, 2026). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.11.2 ### Plugin version langgenius/tongyi 0.1.18 ### Cloud or Self Hosted Cloud ### Steps to reproduce 1. Install **Tongyi plugin v0.1.18** from Dify Marketplace. 2. Configure an LLM using **DeepSeek-R1** in the Tongyi plugin. 3. Select **CHAT** mode. 4. Observe the model context length shown in Dify UI or enforced by the plugin. 5. Compare the configured / displayed context window with the official DeepSeek-R1 specification. ### ✔️ Error log No explicit runtime error. This is a configuration / capability mismatch issue. Bug: The Tongyi plugin incorrectly reports/enforces DeepSeek-R1 context window as 64K, while the official spec is 131,072. This blocks long-context chats and truncates inputs earlier than expected. <img width="425" height="308" alt="Image" src="https://github.com/user-attachments/assets/bd61f915-b990-440e-b90e-9e718f433e2f" /> [The model details shown in the Tongyi/Dify UI on the Aliyun Bailian console also list DeepSeek-R1](https://bailian.console.aliyun.com/?spm=5176.29597918.J_SEsSjsNv72yRuRFS2VknO.2.52007b08jZ957l&tab=api#/api/?type=model&url=2868565 ) <img width="2005" height="729" alt="Image" src="https://github.com/user-attachments/assets/e89082e8-6e35-4dbd-906d-5b13437f0e6b" />
yindo added the bug label 2026-02-16 10:21:02 -05:00
yindo closed this issue 2026-02-16 10:21:02 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 11, 2026):

The context window for DeepSeek-R1 in the Tongyi plugin is currently set to 64,000 tokens in the model configuration file, which is incorrect. The official spec is 131,072 tokens. This value is defined in models/tongyi/models/llm/deepseek-r1.yaml under context_size. The UI and plugin enforcement both reflect this YAML value, so inputs are truncated at 64K tokens instead of the correct limit. To fix this, update context_size to 131072 in that YAML file and restart the plugin—this will allow long-context chats up to the official model limit. No other code or config outside the plugin controls this behavior, so this change is sufficient to resolve the issue.
See the relevant config here.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Jan 11, 2026): <!-- Answer --> The context window for DeepSeek-R1 in the Tongyi plugin is currently set to 64,000 tokens in the model configuration file, which is incorrect. The official spec is 131,072 tokens. This value is defined in models/tongyi/models/llm/deepseek-r1.yaml under context_size. The UI and plugin enforcement both reflect this YAML value, so inputs are truncated at 64K tokens instead of the correct limit. To fix this, update context_size to 131072 in that YAML file and restart the plugin—this will allow long-context chats up to the official model limit. No other code or config outside the plugin controls this behavior, so this change is sufficient to resolve the issue. [See the relevant config here.](https://github.com/langgenius/dify-official-plugins/blob/ef6335b1d8e9b19d5d65454b84213f9c09bd2354/models/tongyi/models/llm/deepseek-r1.yaml#L1-L22) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/520f7d77-2a42-4439-b643-cdd86dc33270?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/520f7d77-2a42-4439-b643-cdd86dc33270?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/520f7d77-2a42-4439-b643-cdd86dc33270?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/520f7d77-2a42-4439-b643-cdd86dc33270?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/520f7d77-2a42-4439-b643-cdd86dc33270?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/520f7d77-2a42-4439-b643-cdd86dc33270?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/520f7d77-2a42-4439-b643-cdd86dc33270?feedback_type=other)</sup> [![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20context%20window%20for%20DeepSeek-R1%20in%20the%20Tongyi%20plugin%20is%20currently%20set%20to%2064%2C000%20tokens%20in%20the%20model%20configuration%20file%2C%20which%20is%20incorrect.%20The%20official%20spec%20is%20131%2C072%20tokens.%20This%20value%20is%20defined%20in%20models/tongyi/models/llm/deepseek-r1.yaml%20under%20context_size.%20The%20UI%20and%20plugin%20enforcement%20both%20reflect%20this%20YAML%20value%2C%20so%20inputs%20are%20truncated%20at%2064K%20tokens%20instead%20of%20the%20correct%20limit.%20To%20fix%20this%2C%20update%20context_size%20to%20131072%20in%20that%20YAML%20file%20and%20restart%20the%20plugin%E2%80%94this%20will%20allow%20long-context%20chats%20up%20to%20the%20official%20model%20limit.%20No%20other%20code%20or%20config%20outside%20the%20plugin%20controls%20this%20behavior%2C%20so%20this%20change%20is%20sufficient%20to%20resolve%20the%20issue.%20%20%0A%5BSee%20the%20relevant%20config%20here.%5D%28https%3A//github.com/langgenius/dify-official-plugins/blob/ef6335b1d8e9b19d5d65454b84213f9c09bd2354/models/tongyi/models/llm/deepseek-r1.yaml%23L1-L22%29)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/2403)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#929