diff --git a/cheddahbot/scheduler.py b/cheddahbot/scheduler.py index 5f8e024..2b58cf8 100644 --- a/cheddahbot/scheduler.py +++ b/cheddahbot/scheduler.py @@ -385,14 +385,19 @@ class Scheduler: continue # Respect auto_execute flag — skip tasks that require manual trigger + # Unless the task status matches an auto_execute_on_status entry mapping = skill_map[task.task_type] if not mapping.get("auto_execute", False): - log.debug( - "Skipping task '%s' (type=%s): auto_execute is false", - task.name, - task.task_type, - ) - continue + status_triggers = mapping.get("auto_execute_on_status", []) + if task.status.lower() not in [s.lower() for s in status_triggers]: + hint = mapping.get("trigger_hint", "manual trigger only") + log.info( + "Skipping task '%s' (type=%s): auto_execute is false (%s)", + task.name, + task.task_type, + hint, + ) + continue # Client-side verify: due_date must exist and be within window if not task.due_date: diff --git a/config.yaml b/config.yaml index 8bed54d..8d36105 100644 --- a/config.yaml +++ b/config.yaml @@ -64,6 +64,7 @@ clickup: "On Page Optimization": tool: "create_content" auto_execute: false + trigger_hint: "content-cora-inbox file watcher" required_fields: [keyword, url] field_mapping: url: "IMSURL" @@ -72,6 +73,8 @@ clickup: "Content Creation": tool: "create_content" auto_execute: false + auto_execute_on_status: ["outline approved"] + trigger_hint: "content-cora-inbox file watcher (Phase 1), outline approved status (Phase 2)" field_mapping: url: "IMSURL" keyword: "Keyword" @@ -79,6 +82,7 @@ clickup: "Link Building": tool: "run_link_building" auto_execute: false + trigger_hint: "cora-inbox file watcher" complete_status: "complete" error_status: "error" field_mapping: