GitHub Repository Contents plugin truncates file content at 2000 characters #887

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

Originally created by @Kielland on GitHub (Dec 20, 2025).

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

Plugin version

0.3.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

The GitHub Repository Contents tool (github_repository_contents.py) has a hard-coded limit that truncates file content to 2000 characters, which prevents users from retrieving complete files through workflows.

In tools/github_repository_contents.py (lines 123-127), the plugin intentionally truncates content:

file_info["content"] = ( decoded_content[:2000] + "..." if len(decoded_content) > 2000 else decoded_content )

✔️ Error log

No response

Originally created by @Kielland on GitHub (Dec 20, 2025). ### 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.1 ### Plugin version 0.3.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce The GitHub Repository Contents tool (github_repository_contents.py) has a hard-coded limit that truncates file content to 2000 characters, which prevents users from retrieving complete files through workflows. In tools/github_repository_contents.py (lines 123-127), the plugin intentionally truncates content: `file_info["content"] = ( decoded_content[:2000] + "..." if len(decoded_content) > 2000 else decoded_content )` ### ✔️ Error log _No response_
yindo added the bug label 2026-02-16 10:20:51 -05:00
yindo closed this issue 2026-02-16 10:20:51 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 20, 2025):

Hi @Kielland! I'm Dosu and I’m helping the dify-official-plugins team.

The 2000 character truncation in the GitHub Repository Contents plugin is enforced by a hard-coded limit in the _invoke method of the GithubRepositoryContentsTool class. Specifically, the code slices the decoded file content to 2000 characters and appends an ellipsis if the content is longer. This only applies to files under 100KB and encoded in base64. There are no comments or configuration options for this limit—it appears to be a simple safeguard, not a documented feature or user-facing setting. To retrieve full file contents, you can increase or remove the limit by editing the relevant line in tools/github/tools/github_repository_contents.py and redeploying the plugin. For reference, see the code here: source.

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 (Dec 20, 2025): <!-- Greeting --> Hi @Kielland! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-official-plugins team. <!-- Answer --> The 2000 character truncation in the GitHub Repository Contents plugin is enforced by a hard-coded limit in the _invoke method of the GithubRepositoryContentsTool class. Specifically, the code slices the decoded file content to 2000 characters and appends an ellipsis if the content is longer. This only applies to files under 100KB and encoded in base64. There are no comments or configuration options for this limit—it appears to be a simple safeguard, not a documented feature or user-facing setting. To retrieve full file contents, you can increase or remove the limit by editing the relevant line in tools/github/tools/github_repository_contents.py and redeploying the plugin. For reference, see the code here: [source](https://github.com/langgenius/dify-official-plugins/blob/559b4b66fa55c40aa95dc5717f586c8ef7aa7237/tools/github/tools/github_repository_contents.py#L109-L119). <!-- 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/9eb7524f-0ca3-422a-8681-98343b0e02d9?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/9eb7524f-0ca3-422a-8681-98343b0e02d9?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/9eb7524f-0ca3-422a-8681-98343b0e02d9?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/9eb7524f-0ca3-422a-8681-98343b0e02d9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/9eb7524f-0ca3-422a-8681-98343b0e02d9?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/9eb7524f-0ca3-422a-8681-98343b0e02d9?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/9eb7524f-0ca3-422a-8681-98343b0e02d9?feedback_type=other)</sup> [![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%202000%20character%20truncation%20in%20the%20GitHub%20Repository%20Contents%20plugin%20is%20enforced%20by%20a%20hard-coded%20limit%20in%20the%20_invoke%20method%20of%20the%20GithubRepositoryContentsTool%20class.%20Specifically%2C%20the%20code%20slices%20the%20decoded%20file%20content%20to%202000%20characters%20and%20appends%20an%20ellipsis%20if%20the%20content%20is%20longer.%20This%20only%20applies%20to%20files%20under%20100KB%20and%20encoded%20in%20base64.%20There%20are%20no%20comments%20or%20configuration%20options%20for%20this%20limit%E2%80%94it%20appears%20to%20be%20a%20simple%20safeguard%2C%20not%20a%20documented%20feature%20or%20user-facing%20setting.%20To%20retrieve%20full%20file%20contents%2C%20you%20can%20increase%20or%20remove%20the%20limit%20by%20editing%20the%20relevant%20line%20in%20tools/github/tools/github_repository_contents.py%20and%20redeploying%20the%20plugin.%20For%20reference%2C%20see%20the%20code%20here%3A%20%5Bsource%5D%28https%3A//github.com/langgenius/dify-official-plugins/blob/559b4b66fa55c40aa95dc5717f586c8ef7aa7237/tools/github/tools/github_repository_contents.py%23L109-L119%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/2303)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#887