mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-19 12:24:46 +08:00
fix(gateway): remove generated markdown on upload delete (#1170)
* fix(gateway): remove generated markdown on upload delete Keep thread upload storage consistent by deleting the generated markdown companion when the original convertible upload is removed. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> Co-authored-by: Willem Jiang <willem.jiang@gmail.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -187,7 +187,10 @@ async def delete_uploaded_file(thread_id: str, filename: str) -> dict:
|
||||
raise HTTPException(status_code=403, detail="Access denied")
|
||||
|
||||
try:
|
||||
file_path.unlink()
|
||||
if file_path.suffix.lower() in CONVERTIBLE_EXTENSIONS:
|
||||
companion_markdown = file_path.with_suffix(".md")
|
||||
companion_markdown.unlink(missing_ok=True)
|
||||
file_path.unlink(missing_ok=True)
|
||||
logger.info(f"Deleted file: {filename}")
|
||||
return {"success": True, "message": f"Deleted {filename}"}
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user