From 1eb7df614322775365eb860622575bbf3bd61522 Mon Sep 17 00:00:00 2001 From: PeninsulaInd Date: Fri, 27 Feb 2026 16:02:54 -0600 Subject: [PATCH] Fix 7: Report attachment upload failures in ClickUp comment When upload_attachment() returns False, the ClickUp comment now includes a warning listing which files failed to upload and their local paths, so Bryan can retrieve them manually. Co-Authored-By: Claude Opus 4.6 --- cheddahbot/tools/press_release.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cheddahbot/tools/press_release.py b/cheddahbot/tools/press_release.py index 64b19e5..061d649 100644 --- a/cheddahbot/tools/press_release.py +++ b/cheddahbot/tools/press_release.py @@ -684,18 +684,27 @@ def write_press_releases( # ── ClickUp: upload docx attachments + comment ───────────────────── uploaded_count = 0 + failed_uploads: list[str] = [] if clickup_task_id and cu_client: try: for path in docx_files: if cu_client.upload_attachment(clickup_task_id, path): uploaded_count += 1 else: + failed_uploads.append(path) log.warning("ClickUp: failed to upload %s for task %s", path, clickup_task_id) + upload_warning = "" + if failed_uploads: + paths_list = "\n".join(f" - {p}" for p in failed_uploads) + upload_warning = ( + f"\n⚠️ Warning: {len(failed_uploads)} attachment(s) failed to upload. " + f"Files saved locally at:\n{paths_list}" + ) cu_client.add_comment( clickup_task_id, f"📎 Saved {len(docx_files)} press release(s). " f"{uploaded_count} file(s) attached.\n" - f"Generating JSON-LD schemas next...", + f"Generating JSON-LD schemas next...{upload_warning}", ) log.info( "ClickUp: uploaded %d attachments for task %s", uploaded_count, clickup_task_id