mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
tongyi plugin temp file #809
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 @WzzP on GitHub (Nov 17, 2025).
Self Checks
Dify version
1.8.1
Plugin version
0.1.1
Cloud or Self Hosted
Cloud
Steps to reproduce
Steps to reproduce
tempfile.gettempdir())Expected behavior
Temporary files created for processing base64 images, videos, and document uploads should be cleaned up after the API call completes.
Actual behavior
Temporary files are created but never deleted, leading to:
Root Cause
File:
models/tongyi/models/llm/llm.pyIssue 1:
_save_base64_to_filemethod (lines 570-585)This method creates temporary files when processing base64-encoded images and videos but has no cleanup mechanism:
This method is called in two places:
Issue 2:
_upload_file_to_tongyimethod (lines 606-621)This method uses
tempfile.NamedTemporaryFile(delete=False)but never cleans up the file after upload:Proposed Solution
Add temporary file tracking and cleanup mechanism:
Implementation Overview
Impact
Environment
Additional Context
This is a resource leak issue that becomes more problematic with:
Willingness to Contribute
I am willing to submit a PR to fix this issue if needed.
✔️ Error log
No response
@dosubot[bot] commented on GitHub (Dec 3, 2025):
Hi, @WzzP. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.
Issue Summary:
_save_base64_to_filemethod inmodels/tongyi/models/llm/llm.pylacking a cleanup process.Next Steps:
Thank you for your understanding and contribution!