Strip all emoji and unicode from runtime strings
Replace emoji prefixes in ClickUp comments and notifications with plain ASCII tags ([FAILED], [DONE], [WARNING], [STARTED], [OUTLINE]). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>master
parent
305b3161c4
commit
fdafa42122
|
|
@ -571,7 +571,7 @@ class Scheduler:
|
||||||
if result.startswith("Skipped:") or result.startswith("Error:"):
|
if result.startswith("Skipped:") or result.startswith("Error:"):
|
||||||
client.add_comment(
|
client.add_comment(
|
||||||
task_id,
|
task_id,
|
||||||
f"⚠️ CheddahBot could not execute this task.\n\n{result[:2000]}",
|
f"[WARNING]CheddahBot could not execute this task.\n\n{result[:2000]}",
|
||||||
)
|
)
|
||||||
client.update_task_status(task_id, self.config.clickup.error_status)
|
client.update_task_status(task_id, self.config.clickup.error_status)
|
||||||
|
|
||||||
|
|
@ -585,7 +585,7 @@ class Scheduler:
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
client.add_comment(
|
client.add_comment(
|
||||||
task_id, f"❌ CheddahBot failed to complete this task.\n\nError: {str(e)[:2000]}"
|
task_id, f"[FAILED]CheddahBot failed to complete this task.\n\nError: {str(e)[:2000]}"
|
||||||
)
|
)
|
||||||
client.update_task_status(task_id, self.config.clickup.error_status)
|
client.update_task_status(task_id, self.config.clickup.error_status)
|
||||||
|
|
||||||
|
|
@ -641,7 +641,7 @@ class Scheduler:
|
||||||
client.update_task_status(task.id, reset_status)
|
client.update_task_status(task.id, reset_status)
|
||||||
client.add_comment(
|
client.add_comment(
|
||||||
task.id,
|
task.id,
|
||||||
f"⚠️ CheddahBot auto-recovered this task. It was stuck in "
|
f"[WARNING]CheddahBot auto-recovered this task. It was stuck in "
|
||||||
f"'{automation_status}' for {age_ms / 3_600_000:.1f} hours. "
|
f"'{automation_status}' for {age_ms / 3_600_000:.1f} hours. "
|
||||||
f"Reset to '{reset_status}' for retry.",
|
f"Reset to '{reset_status}' for retry.",
|
||||||
)
|
)
|
||||||
|
|
@ -860,7 +860,7 @@ class Scheduler:
|
||||||
log.warning("Task %s (%s) missing IMSURL — skipping", task_id, matched_task.name)
|
log.warning("Task %s (%s) missing IMSURL — skipping", task_id, matched_task.name)
|
||||||
client.add_comment(
|
client.add_comment(
|
||||||
task_id,
|
task_id,
|
||||||
"❌ Link building skipped — IMSURL field is empty. "
|
"[FAILED]Link building skipped — IMSURL field is empty. "
|
||||||
"Set the IMSURL field in ClickUp so the pipeline knows where to build links.",
|
"Set the IMSURL field in ClickUp so the pipeline knows where to build links.",
|
||||||
)
|
)
|
||||||
client.update_task_status(task_id, self.config.clickup.error_status)
|
client.update_task_status(task_id, self.config.clickup.error_status)
|
||||||
|
|
@ -927,7 +927,7 @@ class Scheduler:
|
||||||
log.error("Folder watcher pipeline error for %s: %s", filename, e)
|
log.error("Folder watcher pipeline error for %s: %s", filename, e)
|
||||||
client.add_comment(
|
client.add_comment(
|
||||||
task_id,
|
task_id,
|
||||||
f"❌ Link building pipeline crashed.\n\nError: {str(e)[:2000]}",
|
f"[FAILED]Link building pipeline crashed.\n\nError: {str(e)[:2000]}",
|
||||||
)
|
)
|
||||||
client.update_task_status(task_id, self.config.clickup.error_status)
|
client.update_task_status(task_id, self.config.clickup.error_status)
|
||||||
finally:
|
finally:
|
||||||
|
|
@ -1102,7 +1102,7 @@ class Scheduler:
|
||||||
log.error("Content watcher pipeline error for %s: %s", filename, e)
|
log.error("Content watcher pipeline error for %s: %s", filename, e)
|
||||||
client.add_comment(
|
client.add_comment(
|
||||||
task_id,
|
task_id,
|
||||||
f"❌ Content pipeline crashed.\n\nError: {str(e)[:2000]}",
|
f"[FAILED]Content pipeline crashed.\n\nError: {str(e)[:2000]}",
|
||||||
)
|
)
|
||||||
client.update_task_status(task_id, self.config.clickup.error_status)
|
client.update_task_status(task_id, self.config.clickup.error_status)
|
||||||
finally:
|
finally:
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ def _sync_clickup_outline_ready(ctx: dict | None, task_id: str, outline_path: st
|
||||||
|
|
||||||
client.add_comment(
|
client.add_comment(
|
||||||
task_id,
|
task_id,
|
||||||
f"📝 CheddahBot generated a content outline.\n\n"
|
f"[OUTLINE]CheddahBot generated a content outline.\n\n"
|
||||||
f"Outline saved to: `{outline_path}`\n\n"
|
f"Outline saved to: `{outline_path}`\n\n"
|
||||||
f"Please review and edit the outline, then move this task to "
|
f"Please review and edit the outline, then move this task to "
|
||||||
f"**outline approved** to trigger the full content write.",
|
f"**outline approved** to trigger the full content write.",
|
||||||
|
|
@ -100,7 +100,7 @@ def _sync_clickup_complete(ctx: dict | None, task_id: str, content_path: str) ->
|
||||||
config = ctx["config"]
|
config = ctx["config"]
|
||||||
client.add_comment(
|
client.add_comment(
|
||||||
task_id,
|
task_id,
|
||||||
f"✅ CheddahBot completed the content.\n\n"
|
f"[DONE]CheddahBot completed the content.\n\n"
|
||||||
f"Final content saved to: `{content_path}`\n\n"
|
f"Final content saved to: `{content_path}`\n\n"
|
||||||
f"Ready for internal review.",
|
f"Ready for internal review.",
|
||||||
)
|
)
|
||||||
|
|
@ -122,7 +122,7 @@ def _sync_clickup_fail(ctx: dict | None, task_id: str, error: str) -> None:
|
||||||
config = ctx["config"]
|
config = ctx["config"]
|
||||||
client.add_comment(
|
client.add_comment(
|
||||||
task_id,
|
task_id,
|
||||||
f"❌ CheddahBot failed during content creation.\n\nError: {error[:2000]}",
|
f"[FAILED]CheddahBot failed during content creation.\n\nError: {error[:2000]}",
|
||||||
)
|
)
|
||||||
client.update_task_status(task_id, config.clickup.error_status)
|
client.update_task_status(task_id, config.clickup.error_status)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
@ -699,7 +699,7 @@ def _sync_clickup_optimization_complete(
|
||||||
|
|
||||||
# Build comment with validation summary
|
# Build comment with validation summary
|
||||||
comment_parts = [
|
comment_parts = [
|
||||||
f"✅ Optimization pipeline complete for '{keyword}'.\n",
|
f"[DONE]Optimization pipeline complete for '{keyword}'.\n",
|
||||||
f"**URL:** {url}\n",
|
f"**URL:** {url}\n",
|
||||||
"**Deliverables attached:**",
|
"**Deliverables attached:**",
|
||||||
]
|
]
|
||||||
|
|
@ -1018,7 +1018,7 @@ def _run_phase2(
|
||||||
client.update_task_status(task_id, reset_status)
|
client.update_task_status(task_id, reset_status)
|
||||||
client.add_comment(
|
client.add_comment(
|
||||||
task_id,
|
task_id,
|
||||||
f"⚠️ Outline file not found for keyword '{keyword}'. "
|
f"[WARNING]Outline file not found for keyword '{keyword}'. "
|
||||||
f"Searched: {outline_path or '(no path saved)'}. "
|
f"Searched: {outline_path or '(no path saved)'}. "
|
||||||
f"Please re-run Phase 1 (create_content) to generate a new outline.",
|
f"Please re-run Phase 1 (create_content) to generate a new outline.",
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -315,7 +315,7 @@ def _fail_clickup_task(ctx: dict | None, task_id: str, error_msg: str) -> None:
|
||||||
try:
|
try:
|
||||||
cu_client.add_comment(
|
cu_client.add_comment(
|
||||||
task_id,
|
task_id,
|
||||||
f"❌ Link building pipeline failed.\n\nError: {error_msg[:2000]}",
|
f"[FAILED]Link building pipeline failed.\n\nError: {error_msg[:2000]}",
|
||||||
)
|
)
|
||||||
cu_client.update_task_status(task_id, error_status)
|
cu_client.update_task_status(task_id, error_status)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
@ -429,7 +429,7 @@ def run_cora_backlinks(
|
||||||
# ── Step 1: ingest-cora ──
|
# ── Step 1: ingest-cora ──
|
||||||
_set_status(ctx, f"Step 1/2: Ingesting CORA report for {project_name}...")
|
_set_status(ctx, f"Step 1/2: Ingesting CORA report for {project_name}...")
|
||||||
if clickup_task_id:
|
if clickup_task_id:
|
||||||
_sync_clickup(ctx, clickup_task_id, "ingest", "🔄 Starting Cora Backlinks pipeline...")
|
_sync_clickup(ctx, clickup_task_id, "ingest", "[STARTED]Starting Cora Backlinks pipeline...")
|
||||||
|
|
||||||
# Convert branded_plus_ratio from string if needed
|
# Convert branded_plus_ratio from string if needed
|
||||||
try:
|
try:
|
||||||
|
|
@ -482,7 +482,7 @@ def run_cora_backlinks(
|
||||||
ctx,
|
ctx,
|
||||||
clickup_task_id,
|
clickup_task_id,
|
||||||
"ingest_done",
|
"ingest_done",
|
||||||
f"✅ CORA report ingested. Project ID: {project_id}. Job file: {job_file}",
|
f"[DONE]CORA report ingested. Project ID: {project_id}. Job file: {job_file}",
|
||||||
)
|
)
|
||||||
|
|
||||||
# ── Step 2: generate-batch ──
|
# ── Step 2: generate-batch ──
|
||||||
|
|
@ -526,7 +526,7 @@ def run_cora_backlinks(
|
||||||
|
|
||||||
if clickup_task_id:
|
if clickup_task_id:
|
||||||
summary = (
|
summary = (
|
||||||
f"✅ Cora Backlinks pipeline completed for {project_name}.\n\n"
|
f"[DONE]Cora Backlinks pipeline completed for {project_name}.\n\n"
|
||||||
f"Project ID: {project_id}\n"
|
f"Project ID: {project_id}\n"
|
||||||
f"Keyword: {ingest_parsed['main_keyword']}\n"
|
f"Keyword: {ingest_parsed['main_keyword']}\n"
|
||||||
f"Job file: {gen_parsed['job_moved_to'] or job_file}"
|
f"Job file: {gen_parsed['job_moved_to'] or job_file}"
|
||||||
|
|
|
||||||
|
|
@ -574,7 +574,7 @@ def write_press_releases(
|
||||||
cu_client.update_task_status(clickup_task_id, config.clickup.automation_status)
|
cu_client.update_task_status(clickup_task_id, config.clickup.automation_status)
|
||||||
cu_client.add_comment(
|
cu_client.add_comment(
|
||||||
clickup_task_id,
|
clickup_task_id,
|
||||||
f"🔄 CheddahBot starting press release creation.\n\n"
|
f"[STARTED]CheddahBot starting press release creation.\n\n"
|
||||||
f"Topic: {topic}\nCompany: {company_name}",
|
f"Topic: {topic}\nCompany: {company_name}",
|
||||||
)
|
)
|
||||||
log.info("ClickUp task %s set to automation-underway", clickup_task_id)
|
log.info("ClickUp task %s set to automation-underway", clickup_task_id)
|
||||||
|
|
@ -752,7 +752,7 @@ def write_press_releases(
|
||||||
if failed_uploads:
|
if failed_uploads:
|
||||||
paths_list = "\n".join(f" - {p}" for p in failed_uploads)
|
paths_list = "\n".join(f" - {p}" for p in failed_uploads)
|
||||||
upload_warning = (
|
upload_warning = (
|
||||||
f"\n⚠️ Warning: {len(failed_uploads)} attachment(s) failed to upload. "
|
f"\n[WARNING]Warning: {len(failed_uploads)} attachment(s) failed to upload. "
|
||||||
f"Files saved locally at:\n{paths_list}"
|
f"Files saved locally at:\n{paths_list}"
|
||||||
)
|
)
|
||||||
cu_client.add_comment(
|
cu_client.add_comment(
|
||||||
|
|
@ -855,7 +855,7 @@ def write_press_releases(
|
||||||
attach_note = f"\n📎 {uploaded_count} file(s) attached." if uploaded_count else ""
|
attach_note = f"\n📎 {uploaded_count} file(s) attached." if uploaded_count else ""
|
||||||
result_text = "\n".join(output_parts)[:3000]
|
result_text = "\n".join(output_parts)[:3000]
|
||||||
comment = (
|
comment = (
|
||||||
f"✅ CheddahBot completed this task.\n\n"
|
f"[DONE]CheddahBot completed this task.\n\n"
|
||||||
f"Skill: write_press_releases\n"
|
f"Skill: write_press_releases\n"
|
||||||
f"Result:\n{result_text}{attach_note}"
|
f"Result:\n{result_text}{attach_note}"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue