mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
GitHub Repository Contents plugin truncates file content at 2000 characters #887
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Kielland on GitHub (Dec 20, 2025).
Self Checks
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
@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