diff --git a/cheddahbot/scheduler.py b/cheddahbot/scheduler.py index 2b58cf8..ffa60e1 100644 --- a/cheddahbot/scheduler.py +++ b/cheddahbot/scheduler.py @@ -451,6 +451,7 @@ class Scheduler: try: # args already built during validation above args["clickup_task_id"] = task_id + args["clickup_task_status"] = task.status # Execute the skill via the tool registry if hasattr(self.agent, "_tools") and self.agent._tools: diff --git a/cheddahbot/tools/content_creation.py b/cheddahbot/tools/content_creation.py index 72879c3..bc070e6 100644 --- a/cheddahbot/tools/content_creation.py +++ b/cheddahbot/tools/content_creation.py @@ -771,8 +771,12 @@ def create_content( task_id = ctx.get("clickup_task_id", "") # Determine phase from ClickUp task status + # Prefer status passed by scheduler (pre-status-change) over re-fetching phase = 1 - if task_id and ctx: + original_status = ctx.get("clickup_task_status", "") + if original_status and original_status.lower() == "outline approved": + phase = 2 + elif task_id and ctx: client = _get_clickup_client(ctx) if client: try: